dcsimg
Why can't a bean class implement either Remote or Home Interface
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Venkatesh_Sivalingam
Posted On:   Tuesday, July 16, 2002 08:18 AM

Why can't a bean class implement either Remote or Home Interface

Re: Why can't a bean class implement either Remote or Home Interface

Posted By:   Eric_Lindauer  
Posted On:   Tuesday, July 16, 2002 06:00 PM

I believe that bean class can implement the Remote interface, but it is discouraged. The reason is that if you implement this interface, you can pass yourself as an argument to another bean directly, and you will not receive any compile-time complaints. This violates the spirit of EJBs though, as all access is supposed to go through the service layer provided by the appserver implementation.






As for the home interface... you could implement it, but what would be the point? You don't have to implement this interface at all, you just provide it to the appserver and it takes care of generating an implementation which is then stored in JNDI for you ( I think... it's been awhile since I've written these out by hand ). You'll have to look up this appserver implementation if you want to use a remote object, calling the a create method directly in your bean implementation will just result in an object created in memory in the same JVM, which defeats the point.






Hope this helps.

Eric
About | Sitemap | Contact