i would refactor honestly. its probably too much of a pain to try and
keep these classes in the inheritance structure of an ejb.

you can read some examples of how to inherit things in the RMH book.
But its mostly aimed at new development. Since the bean instantiation
class implements entityBean you could have it extend your class, so
now you have implementation in the instantiation, however now you have
to synchronize the remote interface, which already extends EJBObject,
so you are stuck putting all the method signatures in there anyway.
its still going to take a pretty decent amount of work since you are
going to have to check all your classes to ensure you are not doing
something "funky" in the implementation class, or something outright
disallowed. With all the time spent going through the code I would
just refactor it anyway, rather than try to make it work in EJB.

Al

> >Hello,
> >
> >I've a question on inheritence in EJB.
> >As I'm working on the adaption of an existing Java framework, I
have to
> >convert many normal Java classes to EJB. But I'm not sure what to
do with
> >the inheritence. Someone in the list suggested I let the
RemoteInterface
> >inherit from some super interface and let the BeanClass inherit
from the
> >super implementation. This way, if a type of the super interface is
> >expected, then an EJB RemoteInterface can be returned, which looks
quite
> >reasonable to me, so I was trying to do just that.
> >But the problem is, I didn't seem to be able to compile because I
cann't
> >have any constructor in the BeanClass (O'Reilly book), which I do
have in
> >the original class that the bean should substitute:-(
> >I know, normlly the stuff in the constructor is done in the
ejbCreate, but
> >in my case, I have invokation of super() in the constructor, which
is of
> >course bad for EJB. But it didn't work even if I don't use the
super() but
> >move the init code from super class to the bean, compiler simply
says it
> >cann't deal with the constructor in the super class:-(
> >Now I'm wondering, is it that I've done something wrong or is such
thing not
> >possible by definition? Anyone with experience here, comments are
heartily
> >welcome!
> >Also, another question would be: If the purpose of an EJB is to
substitute
> >some normal class, should I put it in it's own package, or should I
leave it
> >in the original package? If I put it in a new package, then many
"protected"
> >access modifier has to be "cracked open" to "public" in the
original
> >package, which seems hairy to me. But I don't know whether it's
> >possible/feasible to package EJBs with the normal classes and make
them one
> >big jar, will the app server have any problem with it?
> >The problems are quite urgent and I'm looking forward to your
reply!
> >Many thanks in advance!
> >
> >regards
> >ZHU Jia
> >
> >
> >_______________________________________________
> >JBoss-user mailing list
> >[EMAIL PROTECTED]
> >http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to