aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJBContext methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJBContext methods" Watch "EJBContext methods" New topic
Author

EJBContext methods

Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
The getEJBObject() and getEJBLocalObject() methods are provided in both EntityContext and SessionContext interfaces. Why didn't they provide these two methods in super interface - EJBContext? ( like in getEJBHome(), getEJBLocalHome() in EJBContext..)
Thanks,
Prasad
Sudhir V
Ranch Hand

Joined: Dec 25, 2002
Posts: 143
good question!!!.
I think this is because of the way EJBObjects behave in Session and Entity beans. There are subtle differences like
"In session beans for a connected client there is one dedicated EJBObject but for entity beans an EJBObject can handle multiple clients. However the home still behaves the same i.e. one home for al beans of the same type".
So I think the implementation of the getEJBObject and getEJBLocalObject needed some change. This is what I think. Does that make sense :roll: Hope someone else throws some light on this.


Sudhir V<br />(SCJP 1.2, SCWCD, OCA, SCBCD)
Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
Sudhir,
I am not sure on what you are trying to explain. My question is not about implementation, it is about the interfaces and its super interfaces. I think implementation never rules the interface design in the object oriented programming.
Prasad
Sudhir V
Ranch Hand

Joined: Dec 25, 2002
Posts: 143
Oops!!! I completely misunderstood the question.
Keith Rosenfield
Ranch Hand

Joined: Nov 25, 2003
Posts: 277
I wondered about this too. My guess is that those method are not provided in EJBContext because they would make no sense for MessageDrivenContext. Since MessageDrivenContext, SessionContext, and EntityContext extends EJBContext, EJBContext should attempt to only provide methods that make sense for all three.
Hope this helps.


Keith Rosenfield<br />SCJP<br />SCWCD<br />SCBCD
Prasad Kuppa
Ranch Hand

Joined: Apr 01, 2002
Posts: 151
Thanks.. but the getEJBHome() and getEJBLocalHome() also do not make sense with MessageDrivenContext ( no home interface for Message driven beans.. )
Prasad
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJBContext methods