What is the use of using session facade design pattern in EJB'S?

Showing Answers 1 - 5 of 5 Answers

tejaswee

  • May 16th, 2006
 

Dear,

 

There are many uses, important one is to reduce network traffic I you are calling many EJB from your Servlet then this is not advised, because it has to make many network trips, so what you do you call a Stateless session bean and this in turn calls other EJB, since they are in same container there is less network calls other thing you can do now is you can convert them to LOCAL EJB which has not network calls. This increases your server bandwidthJ. Problem solver this is good for a highly available system.

 

Cheers

Tejaswee

  Was this answer useful?  Yes

Amitav Ghose

  • May 16th, 2006
 

Using Session Facade pattern you reduce Network trafic .Session Facade is nothing but one layer.In EJB when client acessing business object through remote interface it will increases network traffic and that will affect performance  so to minimise the network trafic bussiness object is called thru local interface.

client--- --remotely-------->sessionbean----localy---->entitybean(where business method is there)

  Was this answer useful?  Yes

Amitav Ghose

  • May 16th, 2006
 

Session facade pattern is use to reduce network traffic  by calling business object locally .In EJB when client call the business object remotely it will increase network traffic and performance will be low.

  Was this answer useful?  Yes

Jacks

  • May 17th, 2006
 

U also hides your business logic with its help, if any change occurs in logic your session facade don't require any change.

  Was this answer useful?  Yes

The Geek

  • Sep 15th, 2006
 

I agree with Jacks to an extent. So called N/W traffic issue is all bookish stuff. OK now see these scenario1) Client calling Entity Bean directly.client -------->Servlet ---------> Entity Bean2) Client calling Entity bean via Session Facadeclient-------->Servlet------>SessionFacade-------->entity beanSo practically speaking we are bringing an additional layer in second scenario.Now why Session Facade is being used is because whenever there is a business logic changed, servlet needn't have to bother about how and what has beed modified, because it is just interested in getting the data from session facade and returning it to the client. So in real world, we are hiding the business logic and bean invocation from the client. This helps in maitaining the system, and allows to make the system modification without touching the client code. I hope this will give you some idea why session facade is used.

The Geek

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions