A client can access EJB thru EJBObject. The EJBObject must know every business method associated w/ EJB thru remote interface. Again, client can�t instantiate an EJBObject directly because EJBObjects could exist on a different machine than the client resides. The client acquires reference to an EJBObject thru HomeObject. The HomeObject implements the home interface, which defines for creating , destroying, and finding EJB objects. Above is my abstraction from the ED ROMAN book. Kindly answer my following questions. 1. Is that true that EJB, EJBObject and HomeObject may reside in different container ?. My comments: HomeObject(EJBObject factory) can locate the EJBObject since it may reside in different m/c. How does the client locate HomeObject in case it resides in other m/c ? 2. I really don�t understand the requirement of HomeObject since all the business methods are available EJBObject(which implements remote interface). Utlimately we need instance of EJB; why we can�t achieve it from the EJBObject itself instead of going thru HomeObject ? Kindly help me out to understand. Thanks
posted 16 years ago
1. Yah. EJBObject and EJB Home can reside on different servers. That's where u r utilising the full capability of EJB. 2.EJBHome is for maintaining the lifecycle of an Enetrprise Bean. It does all the functionality of find , lookup for the bean.There is no meaning non existing of HOME object.