Hi all,

I just sended the following spec comment to Sun.
What are your opinions?

>>>

Hi Linda, Uemit and Sanjeev,

congratulations to the EJB 2.0 spec. You are doing a great job.
I like the introduction of the Persistence Manager role and
the specification of dependent objects very much.

But there is one scenario with dependent objects, where
I would like to see a better clarification in the spec:


Suppose we change the Order/LineItem/Product example in the
2.0 draft (pp 120 ff) in the following way:

The ONE-TO-MANY relationship Product-LineItem is made
bidirectional by inserting:

<cmr-field>
     <cmr-field-name>lineItems</cmr-field-name>
</cmr-field>

Now Product is aware of its relationship with LineItem,
(although this would not make too much sense).

I have a Product p and create a new order o.
Calling o.addLineItem(p, 1, myAdress) as defined on p 122
causes the creation of a new LineItem object and its
addition to the o.getLineItems() collection.

My question is: Does the insertion into o.getLineItems()
automatically insert this dependent object into p.getLineItems() ?
In other words: can an instance of a dependent object be shared
by two entity beans and thus depend on both of them?

I expect the answer is no. The bean provider should be responsible
to write a similar
public void addLineItem(Order o,
                        integer quantity,
                        AddressToShip address)
method on the Product bean and has to call it from within the
Order.addLineItem(...) method. This would result in two "equal",
but not identical LineItems objects, one dependent on an Order and
one dependent on a Product.

Am I right with this?
Anyway I would like to have this subject be mentioned in the spec.

I suggest to change the definition of dependent object (p 111)
into (or something similar with better english):

"A dependent object can be characterized as follows. An object D
is a dependent object, if there exists an object O,
    D is created by O,
    D can only be accessed through O (and not remotely),
    and if D's existence or removal is dependent on O:
in other words, if D's lifecycle is managed by O.
Then D is directly dependent on O. A dependent object depends on
exactly one object directly.
If D depends directly on O and O depends directly on another
object P, then D is called to be transitively dependent on P.
All objects, which are directly or transitively dependent on an
object O, are called dependent on O or inside O, all other
objects are called outside O."


I would really appreciate an answer. Thanks in advance!

Viele Gruesse aus Kiel

Dirk Willecke, Datenzentrale Schleswig-Holstein
mailto:[EMAIL PROTECTED]

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