CHAPTER 1 EJB Layer Architectural Patterns When first designing Enterprise JavaBean(EJB)systems,choosing a correct architecture,or partitioning of logic,that satisfies project concerns,such as performance,maintainability,and portability,is one of most difficult tasks faced by developers.This chapter covers some fundamental architectural patterns in use in the industry today,specifically: Session Facade.The most widely used of all EJB design patterns,the Ses sion Facade shows how to properly partition the business logic in your system to help minimize dependencies between client and server,while forcing use cases to execute in one network call and in one transaction. Message Facade.The Message Facade pattern discusses when and how to partition logic for use cases that are asynchronous in nature. EJB Command.The antithesis of the Session Facade pattern,the EJB Com- mand Pattern advocates placing business logic in lightweight,plain Java Command beans.The main benefits of the pattern are the complete decoupling of the client from EJB itself and the execution of use cases in one network call and transaction. Data Transfer Object Factory.Debunks the old practice of placing DTO creation/consumption logic on the entity bean itself and prescribes centralizing data transfer object creation and consumption logic into a single layer(implemented as session beans or plain java factories). 3 When first designing Enterprise JavaBean (EJB) systems, choosing a correct architecture, or partitioning of logic, that satisfies project concerns, such as performance, maintainability, and portability, is one of most difficult tasks faced by developers. This chapter covers some fundamental architectural patterns in use in the industry today, specifically: Session Façade. The most widely used of all EJB design patterns, the Session Façade shows how to properly partition the business logic in your system to help minimize dependencies between client and server, while forcing use cases to execute in one network call and in one transaction. Message Façade. The Message Façade pattern discusses when and how to partition logic for use cases that are asynchronous in nature. EJB Command. The antithesis of the Session Façade pattern, the EJB Command Pattern advocates placing business logic in lightweight, plain Java Command beans. The main benefits of the pattern are the complete decoupling of the client from EJB itself and the execution of use cases in one network call and transaction. Data Transfer Object Factory. Debunks the old practice of placing DTO creation/consumption logic on the entity bean itself and prescribes centralizing data transfer object creation and consumption logic into a single layer (implemented as session beans or plain java factories). EJB Layer Architectural Patterns CHAPTER 1