Web hosting domain - Chapter 7 Creating session facades for entity beans
Chapter 7 Creating session facades for entity beans When you are designing your EJB applications, it s a good idea to avoid having an EJB client directly access your entity beans. There are at least two very good reasons for this: Each time the client requests data from an entity bean, an RMI-IIOP network call is made. If, for example, the client requests the customer s ID number and the customer s name, two network calls are required. With multiple entity beans and many data requests, your runtime performance can slow markedly. A client that accesses an entity bean directly must know the entity bean s implementation intimately. The client and the entity beans it calls are tightly coupled, which means changes you make in the entity bean will affect the client, too. A popular solution is to use the Session Facade design pattern in which session facades intercede between the client and the entity beans. The client sends requests to the session facade, which forwards the request to the appropriate entity bean. A session facade doesn t do work itself, but delegates the work to other objects. A session facade provides a simple interface. It is the client interface to the underlying system, encapsulating specific knowledge and not exposing it unnecessarily. You can read about the Session Facade design pattern on the Web. Here are some links to get you started: Core J2EE Pattern Session Facade at http://java.sun.com/blueprints/ corej2eepatterns/Patterns/SessionFacade.html EJB Best Practices: Entity Bean Projection at http://www-106.ibm.com/ developerworks/java/library/j-ejb1008.html Best Practices to Improve Performance Using Patterns in J2EE at http://www.precisejava.com/javaperf/j2ee/Patterns.htm Rules and Patterns for Session Facades at http://www7b.software.ibm.com/wsdd/ library/techarticles/0106_brown/sessionfacades.html JBuilder can help you create stateless session facades and data transfer objects (DTOs) for your entity beans using the DTO And Session Facade wizard. Note The DTO And Session Facade wizard is enabled for EJB 2.0 entity beans only. Chapter 7: Creating session facades for entity beans 63
The UK economy was the first in the world to enter the Industrial Revolution, and initially concentrated on heavy industry such as shipbuilding, coal mining, steel production and textiles.All our UK Web Hosting plans are very cheap and they fully support PHP mysql Dreamweaver frontpage and much more.