At 17:01 10.01.01 , you wrote:
>AFIK, inheritance is not allowed in EJB. even if allowd it would create
incorrect. there's no mechanism that allows you to inherit at the component
level but nothing stops you to use inheritance at the interface and/or
class level. I do it all the time, works well and there are good
applications for this.
>numerous problems. When Inheriting the Bean class, you would also have
>to inherit the home and remote object, if not the container does not
>know which bean to instantiate.
incorrect. you specify which class the container should instantiate in your
deployment descriptor. no room for interpretation.
>If you need to subclass your beans, there is probably something wrong
>with the design of your application. If you have to call
strongly disagree. why not refine an implementation, extend an interface,
you name it. works well and is good practice in many cases. I'm not sure if
inheritance solves sacha's problem (I'm not sure I understand it correctly)
though.
>createForPurpose(Purpose p), you should probably create a PurposeNameEJB
>bean.
>
>I've seen something work along similar lines however, this was not
>inheritance but diferent implementations of EntityBean
>1) AccountHome.java (HomeInterface)
>2) Account.java (RemoteInterface)
>3) SavingsAccount.java (1st Implementation)
>4) CheckingAccount.java (2nd Implementation)
ok and what keeps them from sharing a common base class or being extended?
regards,
robert
>(There should probably have been something like AccountInterface.java to
>describe the interface)
>
>the client then did lookups like this
>Object o = ctx.lookup("accounts/savings");
>AccountHome savingsHome = (AccountHome)
>javax.rmi.PortableRemoteObject.narrow(o, AccountHome.class);
>savingsHome.create();
>
>or
>Object o = ctx.lookup("accounts/checking");
>AccountHome checkingHome = (AccountHome)
>javax.rmi.PortableRemoteObject.narrow(o, AccountHome.class);
>checkingHome.create();
>
>so, for both SavingsAccount and CheckingAccount, Account and AccountHome
>where registered as remote and home interface.
>
>sven
(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de
===========================================================================
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".