• Post Reply Bookmark Topic Watch Topic
  • New Topic

Home Interface and Remote Interface  RSS feed

 
Sarmad Sindhi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A session bean contains
Home interface
Remote interface
Session bean Class
Deployment descripter
Home and Remote, they are interface , why they are not complete cleasses ??? Is that becaues thay are implemented by the container???
Please explain in detail
Thanks in advance~
Sarmad
 
Rajesh Hegde
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Home and remote are interfaces that are implemented by classes generated by the container. Its like this:
Home interface extends EJBHome and is implemented by a container generated class. An object of this class "home object" acts an object factory and creates an EJB object. Mind u, EJB object is different from EJB bean. This EJB object is a middle man b/w client and EJB bean. It delegates method calls to the bean.The home object has the create() method that corresponds to the ejbCreate() method of the bean.
Coming to remote interface : this interface extends EJBObject interface and enumerates business methods in the bean. This interface is implemented by another container generated class. An object of this container generated class is the "EJB Object" (the one i mentioned before).
The EJB bean is an instance of EJB class. If its session bean it implements the "Sessionbean" interface ,else "Entitybean" interface. This class has the ejbCreate(),ejbPassivate(),etc and most imp the business methods. The cleint never calls the methods in the bean directly. The methods are called either by the container or the EJB Object.
I think i have given a pretty exhaustive explanation. The best way to get more info is read, the "Mastering EJB" book by EdRooman. Its a free download from the site : "theserverside.com".
Guys on the ranch can correct me is i have missed something.
Rajesh
 
Sarmad Sindhi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Rajesh , I have this book of Ed Roman. however these things were not very clear to me.
Thanks again
Sarmad
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!