Hello,
I want to create generic code and an extensible architecture.
I am getting stuck and I think it is not possible in the EJB model.
Let�s say, I have a base class P with a method (contract) hello(). I can
then create classes A, B, C inheriting from P and then create generic
and extensible code using polymorphism.
With Remote classes inheritance is possible, but not for Home classes.
And of course this is a strong bottleneck, since the only way of
creating or obtaining a handle to a EJB is through its Home interface.
1) IObject objref = initial.lookup("reference");
2) PHome phome =
(PHome)PortableRemoteObject.narrow(objref,
PHome.class);
3) P pointer = (P)PortableRemoteObject.narrow(phome.create(),P.class);
4) System.out.println(pointer.hello());
If I use a reference to a EJB A that inherits from P, obviously I will
get a cast exception in line 2 (PHome and AHome are not related).
Is there any way to use polymorphism and generic code in the EJB model ?
Regards,
Pedro
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".