Java is an object-oriented (OO) language in the tradition of Simula-67, SmallTalk, and C++. It borrows syntax from C++ and ideas from SmallTalk. The Java API has been designed and built on the OO model. Design Patterns (see the book of the same name), such as Factory and Delegate, are used throughout; an understanding of these patterns will help you better understand the use of the API and improve the design of your own classes.
There are any number of short bits of advice that I could give. A few recurring themes arise when learning the basics of Java, and then when learning more Java.
I can’t say this often enough. A lot of the things you need to do have already been done by
the good folks at JavaSoft. And this grows with most releases: 1.2
added the Collections API, and 1.4 added the Regular Expressions API
discussed in Chapter 4.
Learning the API well is a good grounds for avoiding that deadly
“reinventing the flat tire” syndrome—coming up with a second-rate
equivalent of a first-rate product that was available to you the
whole time. In fact, part of this book’s mission is to prevent you
from reinventing what’s already there. One example of this is the
Collections API in
discussed in Chapter 7. The
Collections API has a high degree of generality and regularity, so
there is usually very little reason to invent your own data structuring code.
There is a trade-off between generality ...