Have you seen the Extension Object pattern by Erich Gamma on page 79 of
the book "Pattern Languages Of Program Design 3" by
Martin, Riehle &Buschmann?
You could use this to add new or unforeseen interfaces to existing beans
without impacting clients that don't need the new interface.
This might be preferable to making the specification more complex.
> -----Original Message-----
> From: Karl-Fredrik Blixt [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, June 14, 1999 10:22 AM
> To: [EMAIL PROTECTED]
> Subject: Multiple interface
>
> I'm investigating some problems found during a research project. One
> of the
> major downsides, according to the project conclusions, is that one
> cannot
> have multiple interfaces in EJB. According to the spec one can let the
> remote interface extend multiple interfaces, but that does not permit
> one
> to let a bean implement a new, possibly third-party, interface without
> making changes to the remote interface and the clients using the bean.
>
> Is there any way one can let the bean implement a new interface and
> have
> the clients the way they are? If I for example have a bean with
> interface
> X, the clients look up XHome and receives stubs implementing X. Now I
> also
> want the bean to implement Y, so I extend X and Y into XY (as I
> understand
> is the proposition made in the spec). Can I now let old clients, that
> want
> objects of type X, stay the way they are and just implement clients
> that
> want objects of type Y, or do I need to change the old clients so
> that
> they also know of XY (and thereby also Y) possibly casting to X
> directly?
> These questions arise from the fact that the developers in the project
> come
> from a COM+ background and (from what they have told me) one can
> specify
> what interface one wants returned when looking up an object. Thereby
> one
> can just let old clients be while implementing the new interface on
> the COM
> object.
>
> If it is possible to have the old clients the way they are, I propose
> the
> following changes to the spec. Please comment on the proposal (or even
> the
> possibility to do what I propose):
> * The Deployment Descriptor is given the possiblity to specify
> multiple
> interfaces (which only adds to the spec, still making old descriptors
> valid).
> * The deployment tools are responsible for making a remote interface
> that
> extends all specified interfaces (X and Y are combined into XY which
> is the
> interface returned by the home).
> * Optionally one might want to add the possibility to specify one of
> the
> interfaces in the DD as the "main interface", making it the interface
> returned by the home. Since it is a superclass to the combined
> interface I
> guess this should work.
>
> Thanks for any comments, big or small.
>
> /Kalle
>
> ======================================================================
> =====
> 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".
>
===========================================================================
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".