1.2. How This Book Is Organized

The chapters follow a gradual progression from the simplest type of EJB (stateless session with no database access) to a complete enterprise application with eight EJBs, one web component, and multiple application clients. It's best to read the chapters in this order.

Chapter 2 begins with an overview of the Enterprise JavaBeans architecture. This chapter introduces the J2EE components and explains the role of the application server and container in managing EJBs and the system services they use. You should read this material first if you are new to enterprise beans, but even experienced developers may find it necessary to return to this chapter from time to time. By doing this, you discover how everything fits into the big picture.

Chapter 3 introduces the simplest EJB component, the stateless session bean. Our example, Loan EJB, is a component that produces amortization tables and monthly payment amounts for long term fixed-rate loans. We introduce the Value Object Pattern. After giving you an overview of Java Server Pages (JSP), we also present our first web component client.

Chapter 4 presents Java Database Connectivity (JDBC) with EJBs. In this example, we use a stateless session bean as a database reader. After introducing the basics of JDBC, we show you how to use an EJB for read-only database access. We implement the Data Access Object (DAO) Pattern and explain how to customize an application with a deployment descriptor. The chapter also presents a Swing application client (complete source listing found in Appendix A) and a JSP web component client.

Chapter 5 presents stateful session beans and contrasts them with stateless session beans. This is the beginning of our online shopping application example. Our stateful session bean, MusicCart EJB, is a virtual shopping cart that holds items selected by customers running a JSP web component client. We also introduce the Value List Iterator Pattern and explain EJB local interfaces.

Chapter 6 introduces entity beans. Although our example uses Bean-Managed Persistence (BMP), the reader should be familiar with the material in this chapter because much of it applies to entity beans in general. We present entity bean finder and home methods. Our example is Customer EJB, an isolated “customer” entity bean with BMP. We use the DAO pattern for the persistence implementation. We introduce the very important Session Facade Pattern and local interfaces with entity beans. We enhance our JSP web component client to perform customer lookup and verification against the persistent datastore.

Chapter 7 continues with entity beans. We now explore Container-Managed Persistence (CMP) and Container-Managed Relationships (CMR). We introduce EJB QL, the J2EE query language required to specify custom finder semantics and select methods. Our example includes three related entity beans: Customer EJB, Order EJB, and LineItem EJB. We describe the expanded role of local interfaces and revisit the Session Facade Pattern. The JSP web component client creates customer orders using the data collected in the stateful session MusicCart EJB presented in Chapter 5. The full application now contains seven EJBs, one web component, and an administrative client to inspect the database.

Chapter 8 introduces message-driven beans, the newest EJB component. We begin with an overview of the Java Message Service (JMS) and explain the Publish-Subscribe and Point-to-Point messaging models. Messaging provides a loosely coupled architecture that can enhance the performance of enterprise applications. Our first example is a Message-Driven Bean (MDB) that provides a response mechanism to a client. Our final example is a Java client which sends a message to a ShipOrder MDB. The ShipOrder MDB interfaces with the previously written Session Facade to request the shipment of certain customer orders.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.28.237