Hey

Constantine Plotnikov wrote:
> 1. I do not see the problem with derived bean remote interface extending
> base bean remote interface.
>
> 2. I also do not see the problem with derived bean class extending base
> bean class.
>
> 3. The only serious problem with inheritance support in EJB 1.1 I see is
> that finder method in base class currently cannot return instances of
> derived class because there are now way for finder method to tell right
> type for bean. And I do not see how dynamic aggregation solves this
> problem. Could you please explain your idea?

Well, I'm not the one who invented this, so I guess the ObjectSpace
people can explain it better (and I'm sure they'll correct what I'll say
here...ehm).

Anyway. AFAIK etc.

The inheritance way of implementing classics such as having Persons and
Employees is to subclass Person with Empoyee and adding the fields that
are specific for Emp's. With Dynamic Aggregation you instead keep the
base class Person as it is and instead add roles, or facets. I.e. let's
say that there is a Person Rickard. To view it as a Employee you, in
Voyager, use code like:
Person rickard = ... (find me)..
Employee empRick = Employee.of(rickard);
Which gives you a separate object that is related with the main object
Rickard. When Rickard is removed, all of the associated facets are
removed at the same time.

While it doesn't seem to handle all functionality that is possible with
inheritance (Polymorphism) I think it is a good, and clean, model to add
new functionality to a class. OTOH, it has some other features that are
not possible with inheritance.

If some ObjectSpace dude could elaborate this that would be appreciated.
And the question still stands: how to implement this efficiently in
EJB1.1?

/Rickard

===========================================================================
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".

Reply via email to