GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  EJB
Go To First  |  Previous Question  |  Next Question 
 EJB  |  Question 169 of 175    Print  
Entity bean is an abstract class and its local and home interfaces also extends an abstact class. So how can we instantiate home or local interface?

  
Total Answers and Comments: 3 Last Update: March 08, 2008     Asked by: rajani 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 19, 2007 23:20:29   #1  
avisnk Member Since: January 2007   Contribution: 3    

RE: Entity bean is an abstract class and its local and home interfaces also extends an abstact class. So how can we instantiate home or local interface?
you cannot instantiate an interface. Hence forth you implement the methods in those interfaces in your home and remote interfaces by extending them. Again the EntityBean is not an abstract class but an interface. Hence your bean class makes use of its methods by implementing them.

hope the explanation helps!!
let me know if not clear....

 
Is this answer useful? Yes | No
January 14, 2008 13:34:43   #2  
jayanandan Member Since: May 2007   Contribution: 2    

RE: Entity bean is an abstract class and its local and home interfaces also extends an abstact class. So how can we instantiate home or local interface?
it is upto container which instantitates and maintain all entity bean in the ejb container.
But to act like a entity bean the developer has to implement EntityBean and all abstract methods defined in it.
This is not in the case of EJB3.0 where all those abstract methods implemented by default behind the screen since we use annotation to intimate to the container
that the class is going to act like EntityBean or going to represent the row in table.

 
Is this answer useful? Yes | No
March 08, 2008 09:29:15   #3  
jettyprakash Member Since: March 2008   Contribution: 1    

RE: Entity bean is an abstract class and its local and home interfaces also extends an abstact class. So how can we instantiate home or local interface?

Clients never dealt with direct instances of Entity Bean. It deals with container implementations of home and component interface (stubs & skeletons - aka deployement code)

It is the container responsibility to Wrap a class around the abstract definition of Entity bean.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape