Sachin Aggarwal wrote:
> Reasons I see for an order item being an entity bean.
>
> 1. I feel they have behavior, business logic and *business data
attributes*
> asociated with them which need to persisted independently.
You are saying they are good domain objects, not that they are good EJBs.
This is a different thing - see many prior discussions.
> 2. I feel a lot of the value that EJB brings is in container managed
> persistence so that bean developers can be more productive writing
business
> logic and not have to worry about persisting classes. If we want to
use CMP
> (and the assumption here is that the order item should not be just a
blob
> attribute of the order) then making the order item an entity bean
seems to
> make sense.
Embedding OrderItems into order does not force use of blobs with CMP. It is
true though that current CMP implementations are vendor-specific and
inefficient when faced with complex O-R mappings.
> 3. The system could grow and other objects could have relationships with
> order items directly intead of always having to go through the order
bean.
I agree. This is why I used the term sub-entities rather than dependent
entities. If we consider only those use cases that deal with orders then
OrderItem appears dependent on Order so we build Order as an EJB containing
OrderItems. But if we consider the use cases dealing with product line
management then OrderItems appears dependent on Product so we also need to
build Product as an EJB containing OrderItem.
Unfortunately it is not today possible for OrderItem to be coded without
knowing whether it is to be embedded into Order or Product. Solving this -
the last great unsolved problem of transaction processing(**) - is why I
would like JavaSoft to start architecting sub-entities.
> 4. I don't like the idea of the order entity bean having the
responsibility
> of persisting all the attributes of an order and persisting all the
order
> items and the attributes of each order item.
Well, in my endgame this is not a problem at all since it is a
deployment-time decision how to group subentities into entities and persist
them. Until then we have to live with the need to know which Entity our
subentity is to be embedded in before coding it. Making OrderItem into an
Entity Bean and asking the EJB container-provider to make it perform well
is not a solution.
(**) If we consider the history of transaction processing as being gradual
removal of technical issues from business application logic then this may
not be the last problem, but it is probably the next in importance.
Ian McCallion
CICS Business Unit
IBM Hursley
[EMAIL PROTECTED]
Tel: ++44-1962-818065
Fax: ++44-1962-818069
===========================================================================
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".