Reading the �Core J2EEPatterns � Best Practices and Design Strategies�, I have questions about how session fa�ade could eliminate inter-entity bean communication. In the case of two entity beans (Project, Resource) depending on a single entity bean (Commitment), it is not the best practice of using a composite entity bean encapsulate both �Project� and �Commitment�. (Page 334). The book recommended session fa�ade. It sounds odd to me. Before refactoring: An application client calls to the Project Remote Home Interface, and the Project entity bean calls to the Commitment Remote Home Interface. There are two calls to the Remote Home Interfaces. After refactoring with Session Fa�ade: An application client calls the Session Fa�ade Remote Home Interface. The session fa�ade then calls the Project remote Home Interface. Project entity then calls the Commitment Remote Home interface. There are three calls to the Remote Homer interfaces. It does not look like that Session Fa�ade reduces the inter-bean communication. Instead, it increases it. Why is session facades recommended for eliminating inter-entity bean communication? Thanks a ton in advance.
X. John Wen<br />SCEA, SCWCD, SCJP, MCAD.NET, MCDBA, MCP
hi john, session facade helps by limiting ur n/w calls..(most expensive being remote calls). When the author says inter-bean entity comm here, it is in local address space. so if client c1 calls session SB1 (implemented as facade), its fairly assumed u r calling other ejbs e1...en from SB1 in local space only...only then there is a benefit of this approach.. hope that helps...(off the shelf i tell u facade is used very very extensively in real time scenarios)... rgds,