Hi!

Phan Anh Tran wrote:
> The lifecycle of a pair of  Leg depends on the lifecycle of a
> Person.  Ie.  If a Person was deleted from the database, their Legs would be
> deleted as well.  

This code goes into ejbRemove of PersonEntity, and could easily be
generated automatically.

> If you created a Person, their Legs should be created at the
> same time.  Having 2 EntityBeans, PersonEntity and LegEntity would mean at
> least double the number of potential network calls...not a good thing :-)

You would most likely hide away the Entity-ness of your beans anyway, so
a client would never access them remotely.

> If you have one PersonEntity then you do not have to worry about deleting the
> Leg entities that belong to the deleted PersonEntity.   Same for creates.

As above, this can be handled automatically.

> If an alien came along, the you could model the alien as Alien (plain) with a
> Collection of Leg(plain too).  When you retrieve the Alien, you get all the
> legs in one swoop.
> 
> And the much more important point is what if a newer and fancier component
> technology came along tomorrow?  What are you going do with your EJB references?

They are stored as primary keys, which are composed of primitives. No
problem to port to whatever.

> As a rule, I find it a terrible idea to mix business/problem/application space
> objects with "access" technology such as EJBs.  I consider "access
> transparency" an important goal in achieving maximum re-use of
> business/problem/application logic stuff.

Me too. You *can* have this with the solution we have now, it just
requires more work.

The longterm solution is of course to do proper O/R, but until that time
we have a working workaround IMHO.

/Rickard

-- 
Rickard �berg

@home: +46 13 177937
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.ejboss.org
http://www.dreambean.com


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to