aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Help me" Watch "Help me" New topic
Author

Help me

Lakshmi siri
Ranch Hand

Joined: Feb 06, 2004
Posts: 44
Hi
why ejb needs two interfaces(home,component).
Thank for help.
Lakshmi
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Why does a bar-stool need three legs?


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Lakshmi siri
Ranch Hand

Joined: Feb 06, 2004
Posts: 44
Hi,
I didn't get it.Please explain me.
Thanks. Lakshmi
Dale Seng
Ranch Hand

Joined: Mar 22, 2004
Posts: 275
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).

--Dale--
bhaskar vijay
Greenhorn

Joined: May 17, 2004
Posts: 11
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.
T Rob Darrough
Greenhorn

Joined: Apr 30, 2004
Posts: 11
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.
Lakshmi siri
Ranch Hand

Joined: Feb 06, 2004
Posts: 44
Hi ALL,
Thanks for your help.
Lakshmi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me