Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session facade

 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

Is it allowed to invoke a business delegate from a Session Bean which acts as a session facade?, in other way can a session facade be a client for Bussiness Delegate?. Kindly share your thoughts.

Thanks,
kumar

 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate is for encapsulate business service, so I see no point to use business delegate from session facade.
 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ok Kengkaj I agree what you said, so business delegate will have some business service to be invoked ny its claints, in that case why cant a session bean which acts as a Session facade inovoke the Business delegate to avail a business service please explain. Please note the below point which I have taken from the http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html

"Finally, it should be noted that this pattern could be used to reduce coupling between other tiers, not simply the presentation and the business tiers"

Thanks,
Kumar
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Session facade is already in business tier, it is no point to use Session facade to use business delegate to delegate to other business services which are also in business tier.

If I misunderstood anything, please tell me.
 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ok, Could please tell me what are all the possible clients for a Business Delegate?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taken from the link, clients can be web clients (Servlets), rich clients (such as Swing, SWT/JFace), devices (not sure about this).
 
vikram kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If a servlet which almost has the same responsibilities of an session bean can be a client for a business delegate why not the session bean?
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet and Session Bean is quite different.
Servlet is just for accept request and response, it should not contain any business logic. Moreover they are in different tier, Servlets are in web tier while Session Beans are in business tier.

We can also implement caching in business delegate to reduce network traffic.

Anyway, try to read the link that you posted, it explains well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic