• 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

Object Interaction Diagram of Stateful Session Bean

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I just started preparing for the SCBCD. I have a question on the OID of Stateful Session Bean. As per the Spec when a Client calls the Create method on the Home Object following sequence of steps occur.

1. Creates a new EJB Object
2. Create a Session Context Object
3. Creates a New Instance
4. calls setSesionContext
5. calls ejbCreate

My question here is why not steps 2 to 5 be performed by the EJB Object rather than EJB Home Object?.

Any restrictions on this? Am I missing something here?

Please refer the OID of Stateful Session Bean in EJB Spec (Figure 7) in case of any difficulty in understanding the above question.
Thanks,
Suresh R
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i can think of 2 possible replies to this question

1. The responsibility lies with the Home object. Think about it... We are asking a Home object to create a Session bean for us. So, it should be the responsibility of the Home object to create an instance of *whatever* and return that to us..

2. The OID diagrams are for our understanding. A developer is supposed to think that it works that way.. Who knows how weblogic has implemented it or JBoss has implemented it...

Hope this answer helps...
 
Suresh Ramamurthy
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ganesh for that Reply. What I could interpret from your reply is,
there is no harm in doing Steps 2-5 in EJB Object if any container developer wishes to.
 
Ganeshji Marwaha
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Suresh Ramamurthy:
Thanks Ganesh for that Reply. What I could interpret from your reply is,
there is no harm in doing Steps 2-5 in EJB Object if any container developer wishes to.



That is correct...

I sometimes find it very satisfying when i can visualize how the container vendor might have implemented it... Typically we dont care how the container provider implements it, but if it aids our understanding, then we definitely do care... dont we???
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic