Composite entity pattern: Difference between revisions

Content deleted Content added
m typo; mos
Line 19:
===Drawbacks===
The fatal drawback is the requirement of bean-managed persistent (BMP) [[JavaBeans|bean]]. This involves more work for developers, and craete some problems as follows:
* materializing all the data in a coarse-grained entity whenever it's is accessed, is unacceptably expensive
* In [[Java (programming language)|Java]], implementation of the ejbStore() method needs to be smart enough to avoid issuing all the updates required to persist the entire state of the object, unless the data has changed in all the persistent objects.
Composite entity pattern can only be implemented using BMP or by adding more hand-coded persistence logic to comtainer managed persistance (CMP) [[JavaBeans|beans]]. These both approaches reduce the maintainability.<ref name=":eojdad">{{Cite book|title = Expert One-on-One J2EE Design and Development|last = Johnson|first = R. |publisher = Wiley Publishing, Inc|year = 2003|___location = Indianapolis|volume = |pages = 290}}</ref>
 
==Sample code==
Sample code for a Professional Service Automation application (PSA) in which the resource object is implmentedimplemented via composite entity pattern, may look like as follows (entity implements coarse-grained object):
<source lang="Java">
package corepatterns.apps.psa.ejb;