• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Facade Pattern

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
I have read about this design pattern and one of the advantages listed is that the number of network calls are reduced

I had a few doubts / questions regarding this point :
Case 1 >
Say a Servlet : SvltA makes a call across the network to three different Enity Beans
So here agreed that there is a lot of netwrok traffic

Case 2 >
Introduce a Session Bean with which the Servlet communicates
The Session Bean in turn communicates with the Three Entity Beans

My questions are :

a > Would there not be network calls if the Session bean is on one machine and the Entity Beans on another
In this case would there not be three n/w calls between the session bean and the entity bean ?

b > Does this mean that the Session Bean and the Entity Beans should be on the same machine ?

c > Does this mean that if I were to use EJB 1.1 then even communication btween the sesison bean and the entity beans would involve Stub / Skeleton / Marshalling / Unmarshalling ?

So here the use of EJB 2.0 would be better ?

Finally does this mean that when we say that network calls are reduced we only mean the n/w calls between client and the Bean ?

Regards ,
-satsih
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
onething i remember is that most of the times both the session and entity beans are on the same machine(even after fail over). This is discussed many times and even big time vendors(like IBM and BEA) came with calculations and preferred it to be on the same machine.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by satish pune:
a > Would there not be network calls if the Session bean is on one machine and the Entity Beans on another
In this case would there not be three n/w calls between the session bean and the entity bean ?

b > Does this mean that the Session Bean and the Entity Beans should be on the same machine ?

Yes, the idea with a SessionBean facading EntityBean(s) is that you can do a single set(DTO dto) method call over the network instead of multiple individual setters, and that the SessionBean can do the necessary finer-grained setters against the EntityBean using local interfaces.

Originally posted by satish pune:
c > Does this mean that if I were to use EJB 1.1 then even communication btween the sesison bean and the entity beans would involve Stub / Skeleton / Marshalling / Unmarshalling ?

So here the use of EJB 2.0 would be better ?

Finally does this mean that when we say that network calls are reduced we only mean the n/w calls between client and the Bean ?


Yes, yes, and yes.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic