Hi Guys, i have just stared to understand the EJB architecture. and what i gained is that whole idea of Home interface is to create/instantiate the bean(stateful) , EJBObject and give back the stub of EJBObject to the client , so that client can make a call on business methods using that stub.
My question is why we need home interface at all? why cant it be designed with just one interface(EJBObject) , we can register that object of interface with JNDI and client can look up ,get the stub of EJBObject from JNDI and then that stub can be used to create/instantiate the beans with the help of services from container???
Jeanne , thanks for reply.......but i did not understand your point completely....can you elaborate a little more , why cant container still do the job of pooling and any other services(creating beans with different constructors)......what i want to understand if we remove the call to get the home(EJBHome) from JNDI and get the EJBObject from JNDI directly, how this will impact ??
The purpose of the home object is to create the bean object in the container.
The purpose of the interface object is to allow client objects to call the methods of the bean object (in the container.)
If you remove the call to the home object and never create the bean in the container, then you will not be able to get the interface object from the JNDI namespace because it will not exist. [ December 25, 2008: Message edited by: James Clark ]