• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help me

 
Lakshmi siri
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
why ejb needs two interfaces(home,component).
Thank for help.
Lakshmi
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does a bar-stool need three legs?
 
Lakshmi siri
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I didn't get it.Please explain me.
Thanks. Lakshmi
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALL,
Thanks for your help.
Lakshmi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic