geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: [XML][Deployment]POJO design?
Date Tue, 09 Sep 2003 13:28:50 GMT
	Comments below...

On Tue, 9 Sep 2003, Alex Blewitt wrote:
> Why should session not be able to extend it? I don't understand:
> 
> public interface EJB
> public interface EntityBean extends EJB
> public interface SessionBean extends EJB
> public interface MessageDrivenBean extends EJB
> 
> public class J2EEEJB implements EJB
> public class J2EEEntityBean extends J2EEEJB implements EntityBean
> public class J2EESessionBean extends J2EEEJB implements SessionBean
> public class J2EEMessagDrivenBean extends J2EEEJB implements 
> MessageDrivenBean
> 
> public class GeronimoEJB implements EJB
> public class GeronimoEntityBean extends GeronimoEJB implements 
> EntityBean
> public class GeronimoSessionBean extends GeronimoEJB implements 
> SessionBean
> public class GeronimoMessageDrivenBean extends GeronimoEJB implements 
> MessageDrivenBean


	It does not make sense for GeronimoEJB to extend nothing, and for
GeronimoEntityBean to extends GeronimoEJB.  All the content that
GeronimoEntityBean needs to inherit is in J2EEEntityBean.  The way you've
set it up above, GeronimoEJB needs to duplicate all the code in J2EEEJB in
order to implement the EJB interface, and likewise GeronimoEntityBean
needs to duplicate the code in J2EEEntityBean, and so on.  Whereas if
GeronimoEntityBean extends J2EEEntityBean, all that is inherited not
duplicated.

> ...
> I agree that there should be interfaces (hence above).

	I disagree; the interfaces add nothing, and require lots of code 
duplication.  If GeronimoEJB extends J2EEEJB, then you can treat both 
types as a J2EEEJB without an interface.

> I also agree that the code shouldn't be in one place; it should be 
> split across the two hierarchies. The J2EE stuff should have the 
> vendor-neutral representation, the rest should go into the Geronimo 
> representation. And you can still achieve the transparent connection by 
> providing delegate methods from the Geronimo stuff to the J2EE stuff.

	Yes, two sets of POJOs, one J2EE-only, one Geronimo-only.  You can 
do this without interfaces (but with inheritance).  See comments above.

> If the above types don't gel, I can knock up a skeletal code example 
> for how to represent it, but my thoughts are that the representation 
> should be in a pair of POJOs, not just a single one.

	I understand your position, no code necessary.  I simply disagree.  
Look at the GERONIMO-76 patch for the POJO hierarchy I'm recommending.  
Note that all of the Geronimo classes are virtually empty, though we need 
to introduce a few new ones to cover the references.

Aaron


Mime
View raw message