|
Introduction This book was designed from the ground up for people who have a strong desire to learn all about Java and JavaBeans, in particular. It is not a marketing brochure and it is not a gee-whiz propeller-head technical tome. It is an honest account and appraisal of JavaBeans technology, both the good and the bad. JavaBeans is a wonderful component architecture embraced by, of course, Sun Microsystems and its loyal legion of followers, as well as Microsoft and the other 85 percent of the computing world. For that reason alone, JavaBeans is the single most important API for Java. This book takes a very hands-on approach to teaching JavaBeans technology. There are several code examples, and all of them build on one another from chapter to chapter. The book is designed to be very accessible; you won't see language intended to be understood only by PhDs from Berkeley. Rather, the book attempts to teach you the basics and advanced concepts of JavaBeans with easy to understand examples and code fragments. It is neither insulting nor impossible. All that's required is a firm grasp of the fundamentals of object-oriented programming and Java in particular. What You'll Need The CD included with this book supports both the Windows 95/Windows NT platform as well as the Solaris platform. While Java's write once-run everywhere mantra dictates that the code examples included with the book should run on any Java Virtual Machine that supports Java 1.1.1, any seasoned Java programmer will quickly note that write once-run everywhere is a myth along the lines of Paul Bunyan. Nevertheless, the code has been tested on only Win32 and Solaris platforms. In addition, included is the Java Developer's Kit 1.1.1 for Win32 and Solaris only. Time considerations hampered the ability to include a Macintosh VM. How to Read This Book This book is divided into four parts, and further divided by chapter from there. Because it is highly unusual for a technical book to be read cover-to-cover, the text contains several things that make life easier for those that like to jump around. You will find, interspersed throughout the text, several icons that are designed to grab your attention and point out important features. The API Tip (an example of which can be found later in this introduction), will allow you to search for specific methods contained within a JavaBeans API. The Design Pattern Tip lets you in on some suggested naming conventions for JavaBeans objects. Ideally, of course, the book should be read in order of chapter, but sometimes that is simply not realistic. The icons are there to help you. Parts Is Parts Part One deals with Java and Component Models and provides the foundation for much of your work in JavaBeans throughout this book. In Chapter 1, you will get an understanding of the basic language constructs, including Objects, Serialization, Reflection, and more. In addition, Chapter 2 discusses what components are all about, and how people have been using them in the past and where Java will take them in the future. Part Two addresses the nuts and bolts of JavaBeans. Here, you'll see how to take three different Beans, add events, properties, introspection, and persistence to them, and connect them together. Chapter 3 covers the JavaBeans Event Model, while Chapter 4 talks about JavaBeans and Properties. In Chapter 5 you'll get the low down on JavaBeans and Introspection, and Chapter 6 closes out with Persistence and Packaging. Part Three moves you beyond the daily rigors of coding and covers several Advanced Beans Concepts. The GUI Builder is the single most important aspect of Bean development, and Chapter 7 shows you how to use a GUI Builder to assemble disparate Beans and build an application or applet. Chapter 8 talks about several Bean-related GUI issues that can make your applications prettier and more component-ized. Chapter 9 delves into Bean integration with Microsoft's ActiveX component model and Netscape's JavaScript programming language. Chapter 10 introduces Bean networking by talking about Java Remote Method Invocation (RMI) and Java Interface Definition Language (IDL), the Java binding to industry-standard CORBA objects. Part Four is a lovingly fluffy marketing brochure that was slipped into an otherwise highly technical book. Chapter 11 discusses in marketing-level detail what Beans can accomplish in the real world and what other companies, like Corel and Lotus, are doing with Beans. This had to be thrown in to make Product Marketing Managers happy. Besides, you do want to know why you should do Beans, right? Note: Throughout this book JavaBeans may be referred to as Beans or Beans components. The technical, trademarked name is JavaBeans. But, for the general flow and beauty of the text, from time to time the official name may be shortened. Appendixes There are also three Appendixes that will show you how to do some of the more mundane things with Bean development. Appendix A is a Quick Start Guide that maps out where advanced Java and Beans developers should go for information. Appendix B is a quick guide to the features and bugs of the Bean Development Kit's Bean Box. Finally, Appendix C will show you how to install and run the applications on the CD-ROM included with this book. CD-ROM The CD provided with this book contains some very useful items. The first of these items is the latest and greatest version (1.1.1) of the Java Developer's Kit (JDK). The JDK contains all of the Beans classes and objects that you need to build JavaBeans applications. However, a second component, the Beans Developer's Kit (BDK), is also included. The BDK contains a sample container (discussed in Appendix B) and several example Beans. In addition, the major source code from every chapter is also included. The RainbowButton Bean that is used as an example throughout the book is here in all its glory and excitement. In addition, you can play with examples of reflection, serialization, and more. Conventions Throughout this book, you will see the use of various typographic conventions, which are outlined here. Icons Icons represent called-out material that is of significance and that you, the reader, should be alerted to. These include: (Because of the large number of times the API Tip and Design Pattern Tip are used in succession in the book, their discussions will appear in normal text with a n at the end to(Because of the large number of times the API Tip and Design Pattern Tip are used in succession in the book, their discussions will appear in normal text with a n at the end to denote their conclusion.) Code Code samples, code extracts within text, and other specific items (like methods, arrays,
objects, or classes) are denoted by using the Courier font, like this:
public class Jenny
{
}
Any later additions to the code will be represented in bold face type, like this:
public class Jenny
{
String loves = "Prashant";
}
Note: I never quite understood what a program listing was, and as you will see, I keep
showing fragments of code, followed by additions to the fragments as I go along. You will
also notice that whenever I add a pile of code to an existing pile of code, the new code is
bolded. I have always appreciated it when authors don't skimp on listings and show as
much as possible, in as coherent a manner as possible.
UPC $49.95 USA $69.95 Canada |

| © Prentice-Hall, Inc. A Simon & Schuster Company Upper Saddle River, New Jersey 07458 |