wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Multiple Session Facades? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Multiple Session Facades?" Watch "Multiple Session Facades?" New topic
Author

Multiple Session Facades?

roul ravashimka
Ranch Hand

Joined: Mar 16, 2004
Posts: 53
Hello,
why would we use more then one session facade?
Is it for performance?
Can a session facade be a bottle neck?(I dont think so)
Or per use case, one session facade?
Thanks,
Roul


MSc Electronics, ICT
Sergiu Truta
Ranch Hand

Joined: Dec 16, 2003
Posts: 121
You usually use several session beans as a facade between the client code and the entity beans.
One session bean contains usecases(methods) which implement related work. So for each group of related usecases you implement a session bean.
You shouldn't use a master session bean, one which contains all the facade code, because this will quickly become very large, hard to understand and maintain.
For example if you implement an an on-line application for renting cars, you will have one session bean which contains the methods related to registering users, another session bean for all the operations which provide information about the available cars, another session bean for the operations needed for renting a car, and many other like these.
I hope you got the point


...watch me...as I'm walking the path...
roul ravashimka
Ranch Hand

Joined: Mar 16, 2004
Posts: 53
And it doesn't got anything to do with performence?
It is just about having a better overview, by grouping them by use case.
Kiran Kumar
Ranch Hand

Joined: May 18, 2001
Posts: 107
Hi,
It does not impact performance much.
But in cases where there is functionalities implemented in different session beans and u need to call more than 1 session bean for ur functionality you can have a Session Facade which will wrap the calls for those two or more session beans and make this a coarse grained access. instead of fine grain access by calling each session bean independently. since the EJB's usually is in a Distributed environment and ur client maybe on the presentation tier.
hope this helps.


Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Session Facades?