• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejb home vs ejb object

 
rehans oberoi
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody tell me difference between ejb home and ejb object
thanks
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rehans,
The difference is quite big, and once you fully understand EJB and RMI, it's quite logical.
The EJB object (also know as the component interface) is where your business methods are found. As a bean provider, you must create an interface which extends EJBObject (or EJBLocalObject). Its in this interface where you will DECLARE your business logic methods. At deploy time, the container will implement this interface for your creating the stubs (assuming we're talking remote). In your bean object, although you will NOT implement this iterface, you will define the methods declared in ejb object.

Now, normally your clients will want to invoke one of the business methods which you declared in your ejb object interface and defined in your bean class. But how does your client gain access to the component interface (your ejb object)? Through your home object. A JNDI lookup is needed to get your home.

To explain all this properly with detail, for each bean type, i would be here for ever.

I recommend you pick up a copy of Head First EJB .

Regards,
Mars.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic