|
| ||
There are a number of sources for information on JavaBeans. The ultimate cryptic reference is the JavaBean specification available on the Sun web site. It is pretty good as far as API (Application Programming Interface) specifications go, but it falls short in the discussion of implementation (the how to's and the why's) and examples. But that's typical for an API specification. There is a pretty good introduction to JavaBeans in JavaBeans for Dummies, but come on - would any real programmer be caught dead with one of the 'Dummies' books? You can also go to the ultimate source, at the Sun website, and read the concise JavaBeans Whitepaper. It spells out the basic elements of JavaBeans, it's fairly short, and it's free! The Whitepaper is good if you only need an overview of JavaBeans. If you need to make and use JavaBeans, you will need more details and some examples. There is an excellent book for learning about JavaBeans entitled Mastering JavaBeans by Laurence Vanhelsuwe and published by Sybex. It is part of a series of 'Mastering' books all published by Sybex. This is a real tree killer, weighing in at 800 pages with a 1.5 inch spine. They even used the publishing trick of printing the book using thick paper. This follows the assumption that a $50 book needs to be thick and heavy. I know from firsthand experience that many publishers feel thicker books are better. Fortunately, the book does not fill up appendices with lists of JDK classes and AWT class hierarchies like many early Java books. A review of the strengthsThis book is very technical and it assumes you have a good working knowledge
of Java programming. It is very tool neutral and focuses mainly on the language
enhancements for JavaBeans and use of the JDK classes and tools. Since this book
assumes you have a working knowledge of Java, it definitely should not be your
first Java book. The author, Laurence Vanhelsuwe, comes from a C++ background.
He uses many helpful analogies to C++ and Java JDK 1.02 throughout the book. It
is strange that the examples in the book do not use the Mastering JavaBeans is very comprehensive and it covers the essential aspects of JavaBeans in good detail. There are many examples throughout the book to help illustrate the JavaBeans concepts. The eleven chapters cover the following topics:
As I mentioned earlier, anyone reading about JavaBeans will need to have some Java programming experience. Chapter 1 is not like the rest of the book. It attempts to introduce you to JavaBeans by evaluating the Java language and lightly touches on a number of software development issues. If you are interested in JavaBeans and the V1.1 JDK and you have a minimal understanding of software and programming, you can easily skim this chapter if you have time to kill in an airplane or waiting in the dentist office. But if you are are like me and have too much work and too little time, you can save a little time and skip it altogether. Chapter 2 is where the book starts to get into JavaBeans, and Chapter 3 gets into the good stuff including event sources and listeners, event unicasting and multicasting, and some pretty good examples. The book also points out some shortcomings in the current JavaBean implementation like the single event queue. Chapters 4 and 5 continue describing the JavaBean interface with detailed information on bean properties and events. After completing Chapter 5 you will be much better prepared to use JavaBeans in VisualAge for Java by understanding how JavaBeans are defined. This understanding of how beans work is essential for VisualAge for Java users because Visualage generates most of the code for beans, hiding their complexity from the developer. All the samples use the JDK compiler, but you can import them into VisualAge for Java and work with them in the VisualAge IDE. Chapters 7, 8, and 10 cover much more detail about JavaBeans including
Chapter 9 has an example of a real-time application using a Chapter 11 covers a new feature in the core Java API included in the V1.1 JDK called serialized objects. These are actually outside the JavaBean specification, but serialized beans can be very useful and I'm glad the author included this discussion in the book. Serialized beans are persistent and they are supported in VisualAge for Java. This chapter is very helpful in explaining how serialization works, but more importantly it explains what gets serialized (or saved) and what does not get saved. The book also includes a CDROM with Sun's JDK V1.1.1 (Java Development Kit), Sun's BDK (Bean Development Kit), and the code samples for the book. This has become pretty standard for most books and it is a major plus because it gives you all the tools you need to run the samples in the book. It is also good to have a copy of the V1.1.1 JDK on a CDROM when you use VisualAge for Java. You can use the JDK compiler (javac) and viewers (java and appletviewer) to test and run VisualAge for Java developed applications outside of the VisualAge development environment. There are a couple of things that do not work in the VisualAge for Java IDE, but do work when run outside the IDE. Testing outside the IDE is very prudent every once in awhile, because the IDE environment is not the same as the runtime environment. The weaknessesEven though it is a very comprehensive book, there are a number of criticisms I have about Mastering JavaBeans. Any book review should do more than merely summarize the chapters - it needs to let you know about both the strengths and weaknesses. One of the criticisms I have with this book is the organization of the chapters. For some reason, the author uses Chapter 6 in the middle of the book to cover JAR (Java Archive) files. It really breaks the flow of the preceding chapters and would be better placed toward the end of the book. The organization of any book is key to making sure the reader understands its messages in a comprehensive manner. And making JAR files in VisualAge for Java is very simple, so only tool builders really need to understand their internals. This type of information would be much better toward the end of the book. Another shortcoming is that the Glossary is practically worthless, with definitions of such irrelevant terms like 'kludge' and 'hex dump'. Although I have see my fair share of kludges in software, there are a ton of Java terms that are new and it would have been very helpful to have these explained in the Glossary. ConclusionsAfter going through Master JavaBeans, you will have a good understanding of the conventions used to make JavaBeans and how they work. When you use VisualAge for Java you will better understand the code that gets generated when you create JavaBeans. You will be more comfortable with defining and using bean properties and methods. You will be able to create your own bean events in business logic beans or 'invisible beans'. Even with its minor problems, the book Mastering JavaBeans does a great job and making a somewhat complicated topic fairly easy to learn. I probably would have named the book 'Master JavaBeans and Additions to JDK V1.1', so you would understand what the books really covers. It is definitely worth the $49.95 list price, but don't pay list - use Amazon or some other discounter. As the Java technology continues to evolve, there have been a number of changes since Mastering JavaBeans was published. Recently, Netscape Communicator V4.02 with Netscape Navigator now supports JavaBeans. Also, the HotJava browser from Sun supports JavaBeans. You can always use the appletviewer in the JDK to look at applets, but as the industry browsers become available, you will easily be able to deploy beans on the Internet. Sun has said that Microsoft's Internet Explorer (IE), Visual J++, and Visual Basic will support JavaBeans. Since Internet Explorer gets pre-installed on many PCs and a number of companies have adopted it as a standard, it will be real helpful when Internet Explorer supports JavaBeans. Until IE's jvm (Java Virtual Machine) is updated, your JavaBeans will not run as applets in Internet Explorer. But the Java development community is not waiting - there are a number of projects deployed and many more in development using JavaBeans. Java, Netscape Navigator, VisualAge, Visual Basic, Visual J++, Windows95, and Windows NT are trademarks of the respective companies that own them. Mastering JavaBeans Enjoy the article? Subscribe to Eye on Objects! | ||
|
Dale Nilsson is a Senior Software Consultant with IBM VisualAge. He has been programming software since 1976 using a number of different programming languages using PCs, minis, and mainframes. He has experience working with customers and vendors throughout the United States, Europe, Asia, and South America. Dale currently works with customers providing software consulting and education, technical presentations, and application design using Visualage for C++ and VisualAge for Java. He is also an Advisor and Contributor to the VisualAge Certification program. | ||
| ||
![]() |