IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New EJB Session Beans and inheritance question
In the application that I started working on they are using inheritance in a way that I have never seen before with EJB's. The situation is as follows (here are the classes/interfaces involved)

  • License - interface which defines various methods related to licensing

  • LicenseImpl implements License - note these (the interface and the implementation) are POJO's (plain old Java objects)

  • LicenseBean extends LicenseImpl implements SessionBean - the License session bean which inherits from a POJO

  • LicenseRemote extends License, EJBObject - this is the EJB's remote interface, extends the POJO interface

  • LicenseFactory - a factory class which decides whether to return an EJB (LicenseBean) or a POJO (LicenseImpl) based on some criteria, in any case it returns an instance of License.


This this was done so that the LicenseImpl implementation could be used outside of the EJB server if needed, therefore it is a POJO.

My questions are as follows:

  1. Has anyone seen this being done anywhere?

  2. Is this spec compliant?

  3. Do you think this is a good design?


Thanks,
New AAHHHH!!! (sorry)
-drl
New This is what comes of
trying to remote objects with static or "function calling" interfaces. Silly, no?



"I believe that many of the systems we build today in Java would be better built in Smalltalk and Gemstone."

     -- Martin Fowler, JAOO 2003
New Re: EJB Session Beans and inheritance question
"Has anyone seen this being done anywhere?"

I think this is a fairly typical technique for exposing a regular Java class as an EJB.

"Is this spec compliant?"

Which spec? It should work fine.

"Do you think this is a good design?"

I don't think EJB is a good architecture so on that basis alone I'll say its stupid. The indiscrimitate remoting of objects results in crap performance. Most people using any kind of EJB successfully are using the local interfaces.

OTOH, given the constraints of EJB and the apparent desire to be able to use this class locally and remotely (why I have no idea) I think its a fine solution to the problem that you probably shouldn't have.




"I believe that many of the systems we build today in Java would be better built in Smalltalk and Gemstone."

     -- Martin Fowler, JAOO 2003
New ICLRPD (new thread)
Created as new thread #132980 titled [link|/forums/render/content/show?contentid=132980|ICLRPD]
===

Implicitly condoning stupidity since 2001.
     EJB Session Beans and inheritance question - (bluke) - (4)
         AAHHHH!!! (sorry) -NT - (deSitter) - (1)
             This is what comes of - (tuberculosis)
         Re: EJB Session Beans and inheritance question - (tuberculosis) - (1)
             ICLRPD (new thread) - (drewk)

Nine crows at nine o'clock nigh.
43 ms