• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

' session facade ' some confusion

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am studying some j2ee design pattern so I want to be sure that what I have understood is indeed correct or not !

session facade is a design pattern where we call like client program will call a session bean which will call an entity bean which will call a database . I mean client lookup---->session bean----->entity bean---->DB

ok ? now we implement this pattern so that network traffic gets reduced and application will run much faster . right ?

now as we do like this structure like lookup client program to session bean to entity bean to database . we should make the session bean local or remote ? then for session bean entity bean should ber local/remote ? which is the best design ?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


session facade is a design pattern where we call like client program will call a session bean which will call an entity bean which will call a database . I mean client lookup---->session bean----->entity bean---->DB


Its more simple than that. The session facade is the entry point for your applciation logic. Your client connects to it to call the supplied business methods - what happens after that is immaterial (from the client's point of view anyway). Its doesn't imply the use of entity beans.


now we implement this pattern so that network traffic gets reduced and application will run much faster . right ?


No. The pattern is introduced to leverage container provided services. By accessing your application through a Session Facade it means the application has the ability to use container managed transactions, declarative security, to cluster and scale etc.


now as we do like this structure like lookup client program to session bean to entity bean to database . we should make the session bean local or remote ?


The client can look up a local instance if it has the capabilitites to do this (e.g. it is running in the same JVM as the EJB application). More normally the client will look up a remote interface.


then for session bean entity bean should ber local/remote ? which is the best design ?


Yes. Remote entity beans are a bit of an anti-pattern (entity beans full-stop are a bit of an anti-pattern to be honest!). If your session facade bean is going to call another EJB it make sense for the vast majority of occasions to call a local instance.
 
Dinner will be steamed monkey heads with a side of tiny ads.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic