HI all
>However the EJB spec does not allow for inheritance between EJBs
I did not see any notes in the spec of EJB where it is said inheritance NOT ALLOWED.
sure i agree isA is not supported by EJB but it is easy to implement it.
Agree, we cannot inplement 100% isA functionality as Edward said before but some kind
of inheritance is possible and works very fine for my project.
I using BMP entities + session beans.
I have Contact.java, ContactHome.java and i have implemented inheritance:
public interface EMailContact extends Contact
public interface EMailContactHome extends ContactHome
public interface InboundTelephonyContact extends Contact
public interface InboundTelephonyContactHome extends ContactHome
.....
My Contact (BMP) replesents data in the oracle table Contact
My EMailContact (BMP) replesents data in the oracle table EMailContact + all data
replesented by Contact
My InboundTelephonyContact (BMP) replesents data in the oracle table
InboundTelephonyContact + all data replesented by Contact
...
I dont need reimplement setters, getters for inherited functions of Contact; i do
implement just new functions it helps me very much.
Because i use BMP My XXXContact bean functions create, store, load,remove calls parent
bean function first and does contact specific job later.
IsA implemtation i did using SessionBean and it is not any pain in the ass and parrent
dont need to know about childs at all.
If my parent bean calls findAll (or some Collection ejbFindXXX()) and get the
Collection of PK; i use SessionBean::Contact findContact(ContactPK
inContactPK) where child bean is returned.
If I added any new
XXXContact extends Contact
I dont need implement neither Parent bean nor Session bean and i have possibility to
get real XXXContact.
D&D
On Tue, 6 Feb 2001 07:54:11 -0000, Kenworthy, Edward wrote:
>
>You're still missing my point !
>
>The reason for choosing an OO programming language is that it *supports* the
>various OO constructs - inheritance, classes, polymorphism and all the
>behavour that is implied (eg inheritance without resulting isA behaviour
>isn't true inheritance.)
>
>You would be mad to try and programme in a fully OO way using an 8 bit
>assembler language, because you would have to hand code all of the support
>for OO that an OO language has built into it. This would lead to a
>maintenance nightmare. What happens if someone else modifies your code and
>fails to follow your hand-crafted implementation of some OO feature ? It's a
>real pain in the arse.
>
>Enterprise Java Beans are implemented using Java. However the EJB spec does
>not allow for inheritance between EJBs (the major issue being with entity
>beans.) It doesn't support it. Can you hand craft support for isA
>inheritance ? Sure, but that's rather missing the point, as I explained
>above.
>
>Clear now ?
>
>
>-----Original Message-----
>From: Peter Routtier-Wone [mailto:[EMAIL PROTECTED]]
>Sent: 05 February 2001 18:20
>To: jBoss
>Subject: Re: [jBoss-User] IsA behaviour when inheriting beans
>
>
>I have just exercised my suggestion and it works.
>
>After deserved criticism from Mr K's for my sloppy wording - I should have
>said "will work in all cases that are obvious to me" instead of projecting
>my own viewpoint universally - I was rather worried that "this" might
>resolve to the interposition class, but it resolved to the bean as I'd
>hoped.
>
>This mail list doesn't allow attachments but sample code can be had from my
>web server. http://wamoz.com/interest.zip
>
>Given the limited extent of my EJB experience I wouldn't doubt for a moment
>that there are cases where this won't work. I'm hoping to learn quite a lot
>when Mr K supplies an example case where this approach isn't viable.
>
>To test the sample, follow the build, deploy, test instructions at
>http://www.jboss.org/documentation/jboss_win32_trail_index.html or
>http://www.jboss.org/documentation/jboss_linux_trail_index.html depending on
>your platform. The sample code at http://wamoz.com/interest.zip contains a
>modified version of the
>sample to which the trail refers.
>
>Follow the instructions there but use my source. Note that on my version of
>Windows the classpath for the test client needed quotes as shown.
>
>java -classpath
>"%CLASSPATH%;..\..\lib\ext\ejb.jar;..\..\client\jboss-client.jar;."
>InterestClient
>
>When you run the sample you will see that InterestBean is identified as
>assignment compatible with the SessionBean interface and identified as NOT
>assignment compatible with java.util.Hashtable. In both cases this is the
>expected and desired behaviour.
>
>Peter Routtier-Wone
>---------------------------------------
>One day, all this too shall parse.
>
>
>
>
>--
>--------------------------------------------------------------
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>List Help?: [EMAIL PROTECTED]
>
>
>--
>--------------------------------------------------------------
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]