Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

' session facade ' some confusion  RSS feed

 
kenji kunoichi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • 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 ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!