• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is the J2EE Composite Entity pattern dead?

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From my readings of Alur et. al., the Composite Entity pattern has proved quite useful, in that a coarse-grained entity EJB model exists for use via session facades, etc. Composite Entity appears to be quite useful in the pre-EJB 2.0 days, when a local calls did not exist.
IMHO, with the use of local calls, relational-object mapping can be fine-grained, i.e. one CMP entity-bean per table row, and then a session facade realizing a use-case with local calls to the CMP entity-bean. More importantly CMR (container-managed relationships) keeps multiple entity beans consistent throughout.
Thus, the old composite entity bean appears to be dead. I would appreciate any comments.
Thanks.
[ September 29, 2003: Message edited by: ahmad namini ]
[ September 29, 2003: Message edited by: ahmad namini ]
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The newest edition of Core J2EE Patterns was written with EJB 2.0 in mind. The writing has the composite entity bean in the list of patterns. It recommends it in the front five chapters.
Where is your opinion derived from?
 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you take a look at Floyd Marinescu's writings, he seems to acknowledge this thought. See the following URL:
http://www.theserverside.com/events/videos/FloydPatterns/text/txt09.html
I have not yet read Alur et.al. updated book, but I would imagine that Composite Entity pattern might be useful only for BMP-beans.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's been a few weeks since I read my copy of Marinescu's work. IIRC he's talking about EJB 1.1 and he's probably right about avoiding groups of fine grained EJBs.
IIRC the example Core 2nd ED gives for composite entity is Order and n line-items. Order represents the bean a facade or application service accesses. The n line-items are all local ejbs. Somebody somewhere says the line items will not have a remote interface.
It makes sense that if the order is deleted all line items are deleted.
It makes sense that when the business tier needs to deal with a line item it will be through the order.
If a data mining application wanted to look at line items it might well be through a DAO which did not really care about the order details.
CMR allows the order bean to maintain a collection of references to the line items.
I can easily see a Order Transfer Object containing the order and line item details.
IMO, in this case and many others the Composite Entity Bean seems to be a good stategy.
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may find the following thread interesting
Chris Mathews goes off on J2EE.
If you will note Chris is the J2EE forum moderator.
 
ahmad namini
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ... Nice thread indeed.
IMHO, the Composite Entity design pattern should be deprecated. However, coarse-grained views of relational data will always be needed.
I like the following possibilities:
1. Fine-grained entity beans with a session bean having a composite view of the entity beans.
2. Fine-grained entity beans with a plain old Java object (POJO) composite view.
3. Fine-grained entity beans with a entity bean (BMP, but I guess a CMP would work as well) composite view.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic