To EB or not to EB, that is the question...
What say we tear into this discussion? What are entity beans? When do they add value? What becomes of plain old
DomainObjects? What are the comparative merits and demerits of the following usage styles?
Three general ways to use them identified to date seem to be:
And one specialized way, attributed to
DaveMuirhead. Does anyone else
HaveThisPattern?
See also:
IbmSanFrancisco
--
RandyStafford
I am not sure I have seen
SearchResultAsEntityBean, but there was a thread a while back on EJB-INTEREST proclaiming the merits of
EntityBeans that represent collection rather than instances. There is even an EJB Container which has optimized for this (Egypt I think).
I does seem strange given that an
EjbHome and its
EjbBean are already sort of a virtual collection of
EjbBean's, where each
EjbBean's
PrimaryKey is its unique identifier in the
EjbHome.
--
ChrisRaber
The problem is that you can't write the 'batch' operations in the Home, which seems natural.
That's not strictly true. With
EjbTwo you get
EjbHome methods which can work on multiple beans in much the same way that static methods could work on multiple (or all) the instances of an object.