• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Session Facades?

 
roul ravashimka
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sergiu Truta
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
roul ravashimka
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic