| Previous | Table of Contents | Next |
Java is steadily becoming the language of choice for new enterprise-wide development projects. A number of factors have lead to this explosion in Javas popularity as a programming language and in particular as a language for large scale development projects. If you are reading this book, we expect that you already have some familiarity with Java as a programming language, and wont bore you with the laundry list of marketing buzz words that are often used to excite folks about Java. Instead, we have focused this book on the enterprise technologies that Sun is standardizing for the Java developers. These technologies, as standards, are motivating numerous companies to move their new projects onto the Java platform.
Our goal for Developing Java Enterprise Applications is to provide developers and evaluators alike an opportunity to learn about Java enterprise development at a technology level and from the perspective of a real world project. There are a number of emerging Java technologies and we have taken a snapshot of the available libraries, frameworks, and tools. Certainly, the list of available technologies will grow, but this book should serve as a solid foundation for your Java development.
Currently the main technologies being adopted, or about to be adopted, by enterprise developers include JDBC for database connectivity, the Java Naming and Directory Interface (JNDI) for accessing services, and RMI for Java remote method invocation and distributed objects. On top of this foundation are Servlets, JavaServer Pages, Enterprise Java Beans, Java Messaging Service, and Transaction Management. All of these combine into a feature-rich tool kit for developing Java applications.
You may have noticed that in all this discussion, we have made no mention of one of the more pervasive and potential influential technologies in enterprise development, CORBA. In researching and writing this book, we realized that their just wasnt room to do CORBA, and the Java technologies for accessing it, justice. Seeing the number of books that just discuss Java and CORBA, we decided that our time, and your money were better served discussing the other technologies well and leaving CORBA for a separate manuscript. We both realize that it would be short-sighted to expect Java developers to ignore CORBA, and we do not intend that. Rather, we decided to leave it out for the opposite reason, and ensure that your research into CORBA is complete and productive.
You will find three types of chapters in this book. First, each technology is introduced, the underlying concepts are discussed, and comparable technologies are described. Second, the programming techniques and technical concepts required to use a technology are described using small examples. These chapters provide a framework for studying larger examples. Each technology that this book focuses on has a targeted example provided for it. This example solves a medium size problem and provides a larger context for learning what the technology is for and how it is used. Finally, the book is concluded with two large examples. These tie together numerous concepts from the book and are intended to provide a stepping stone to your real world development projects.
At least that is the general idea. If we look at a specific example, Servlets, we see Chapter 6: What Are Servlets? introduces the concept of a servlet as a Web server extension. Chapter 7: Programming Servlets discusses the details of creating a servlet, and provides a number of small examples. Chapter 8: A Servlet-Based Search Engine demonstrates how servlets can be used to create a Web site search engine. Finally, Chapter 25: A Four-Tier Online Store uses a number of servlets in the creation of a small on-line store. And thats just for servlets. RMI, JavaServer Pages, Enterprise Java Beans, and Java Messaging Service all have the same, if not more, coverage. Also, JDBC and JNDI have chapters to introduce them, and describe the basic techniques required to use them. We decided that since these technologies show up in so many other places, it wasnt necessary to provide a single large example for them. One note about JBDC; it is a fairly lengthy topic, and if you are planning extensive database access we suggest that you use a book that focuses on JDBC. Like CORBA we didnt think that we could meet our main goals and do JDBC justice. But we thought that it was necessary to provide the basics here as a foundation for the other examples.
Based on this underlying design template the book is organized into the following chapters:
As you can see, the basic flow for each technology is an introduction followed by details and an example. Finally, two large examples are used to tie the concepts together. We strove for educational clarity and usefulness in our examples, so please do not consider them the end all be all of programming. We have tried to show the tradeoffs we made, but there were tradeoffs. Please keep this in mind as you study the example code.
This book is designed for two types of readers. First, technical evaluators should be able to use the introductory chapters to learn about each technology at a high level. Then the example chapters can provide demonstrations for what the technology can do. Experienced Java programmers can use the programming chapters to learn the new libraries and classes before diving into the example code to see how these programs really work and get ideas for their own projects. Both types of readers should be able to leverage the rules and guidelines throughout the book in future projects.
This book covers a lot of topics. You may want to read it straight through or jump around. In either case, keep in mind the design template discussed above so that you can jump to a technology without jumping into the middle of it, unless you want to. If you are planning to read the code for the examples, you should already have experience writing Java programs, including basic threads programming. If you have also used the networking libraries, that will help with some of the distributed technologies, although it is not a requirement.
One problem we encountered when writing this book is that enterprise programming needs a lot of deployment support. In particular, JDBC needs a database to access, JNDI needs special service providers, Servlets and JavaServer Pages need a Web server, EJBs need a host and JMS requires a service provider as well. For JMS we have written a sample provider that is discussed in Chapter 26: MiniJMS. For JDBC we have often discussed ODBC to meet the most commonly available database engines. But we have also provided a demonstration version of Cloudscapes JDMS a pure Java database engine on the CD-ROM. For EJB examples we have included a demonstration version of the BEA WebLogic application server on the CD-ROM. This server also provides some JNDI services, as do the sample providers available from Sun. For servlets, we have included the Servlet Development Kit. Unfortunately, you will need to download a server, possibly from Sun, that supports JavaServer pages to test the examples.
Thats quite a list. Each chapter that introduces a new technology will provide specific details for the programs and tools you need to run the examples from that chapter.
All of the examples rely on the standard Java Development Kit, we chose 1.1.6 and 1.2. Many use the Swing user interface library as well. Java 2 is provided on the CD-ROM, while both the 1.1 JDK and Swing can be downloaded from Suns Web site.
Although we did our testing on Windows NT, Windows95, and Windows98 all of the examples are pure Java and should be easily run on other platforms. Please refer to the Web site for this book at http://www.crl.com./~sasbury/ejava/ for the latest information on these examples. You can also use that site to let us know of any problems you have with a particular version or operating system so that we can let others know about those issues.
Java is a growing, changing and expanding technology. You will always hear about the next version just when you learn the newest one. As authors this can be especially challenging for us. We have tried to provide the best available information in this book. However, we know of some rumors and releases already and for completeness have listed them here.
At the time we are writing, Enterprise JavaBeans was at version 1.0. Sun has already announced that there will be a maintenance release, probably called 1.1, that may appear before this book is published. This release is designed to fix bugs and resolve issues with the JDK security model. Sun is also working with its partners on EJB 2.0. Little information is available on this release at the time of this writing, but indications are that it will build on the 1.0 release, so what you learn here will provide a firm foundation for future versions. Sun has also indicated that they will probably provide a reference implementation for an EJB host. This will allow you to test your EJB projects in a product independent environment.
The Java transaction APIs were not finalized at the time of this writing and may change somewhat in early 1999. Please use the latest documentation on your EJB host and Suns Web site for information on transaction management. Keep in mind that changes to JTA may effect the EJB specification as well.
The Servlet specification is being refined and updated. Like EJB, the content of this book should provide a great foundation for your work with future versions of servlet programming. JavaServer pages are also being updated and the new specification is discussed in some detail in chapter 10.
Things will always be changing, but for enterprise projects you want a stable development platform. We strongly suggest that for at least the first half of 1999 that you stick to JDK 1.1.7 and possibly 1.2 for deployment. Also stay with the earlier versions of the enterprise APIs until the new versions are fully supported by your server vendors. This means EJB 1.0, JDBC 1.0 and the other versions discussed here. Although specifications are being updated it will often take time for the service providers to update their code. A great example of this is JDBC where 2.0 is nearly out but the drivers are not yet supporting it. As a result we have discussed 2.0 features but have not included examples of JDBC 2.0 here.
Our goal in writing this book was to provide a solid, example rich, introduction to the Enterprise Java Technologies. We cant hope to discuss every issue in enterprise development, despite how hard we tried. We can hope that you will use this book to start your journey into Java enterprise development. Please let us know how you do and what you would like to see in future books so that we can continue to provide a solid programming introduction to new technology.
| Previous | Table of Contents | Next |