-
1. Re: Do Session Beans have to implement an interface?
pvanonselen Jan 12, 2006 2:02 AM (in response to glennimoss)As far as I know you need an interface to be created manually and the container does not create it for your.
If you have a nice IDE like Eclipse 3.1.1 you can extract an interface file from your session bean automatically by right clicking on the Session bean and then click on Refractor -> Extract interface. Then you can just add wour @Remote or @Local tags. -
2. Re: Do Session Beans have to implement an interface?
glennimoss Jan 12, 2006 10:48 AM (in response to glennimoss)Ok, I found where I got this idea from.
http://www.javaworld.com/javaworld/jw-08-2004/jw-0809-ejb.html
On the first page it says:
"In the EJB 3.0 world, all kinds of enterprise beans are just plain old Java objects (POJO) with appropriate annotations... you don't necessarily have to implement a business interface (the container can generate it for you)."
And on the second page:
"If it does not implement any business interfaces, a business interface will be generated using all the public methods. If only certain methods should be exposed in the business interface, all of those methods can be marked with the @BusinessMethod annotation."
Of course I'm just noticing that this article is almost a year and a half old, so things may have changed quite a bit since then. If it has changed, does anyone know where in the spec drafts it changed? I'd be interested in the rationale behind this. I think it would be really great to eliminate the redundant (from a conceptual point of view) interface for each bean. -
3. Re: Do Session Beans have to implement an interface?
minamoto Jan 12, 2006 11:07 PM (in response to glennimoss)"glennimoss" wrote:
Of course I'm just noticing that this article is almost a year and a half old, so things may have changed quite a bit since then. If it has changed, does anyone know where in the spec drafts it changed?
See the Revision History page of the EJB 3.0 Simplified API PFD (P.58). I think the Public Draft dropped the feature:Removed requirements for support of generated interfaces. Generation of interfaces may be supported by tools.
Miki