If there were less than three legs, it would fall over!
Same with home and component. If you didn't have a home interface, you wouldn't be able to make new beans, find beans, etc. And if you didn't have a component interface, you really wouldn't be able to do anything useful (home is like the cookie cutter, and each component is like a cookie).
Hi lakshmi, I guess........ Home interface acts as gate way for the bean ie its responsibility is creation and destroying the beans.where as Component interface represents bean it self(ofcourse not directly attached).The container want devide and conquer to the extreme by doing so.
If you have no home then where would you go to find or create an entity? To JNDI? That would mean every entity in the database would have to have a name in JNDI. The volume would be prohibitive. How would the container manage access, since you are not going to thru the container when you do a lookup in JNDI. How would create methods be implemented; JNDI cannot have a name for every bean that might be created. Besides, JNDI cannot instantiate things.
I suppose JNDI could have a reference for one randomly chosen instance of each entity class. Still records for that randomly chosen class would have to be locked more or less permanently. And what would happen when anyone deleted the entity? What if there were no records for a given table, and therefore no entities for the corresponding entity class?
Think about it this way: the difference between a home and a component is the difference between a automobile factory and an automobile.