Page 1 of 1

About Question enthuware.ocpjp.v7.2.1170 : Is the Composite pattern on the exam?

Posted: Fri May 30, 2014 11:46 am
by telston
Would you agree that the definition of composition is distinct from the definition of the composite pattern? The composite pattern has to do specifically with composing a tree structure from objects of a class that implements an interface that declares the tree's behavior. Each object in the tree is a leaf or contains one or more instances of the class of which it itself is an instance. Since the tree is created from instances of the same class, the class does provide the implementation of its owned components; it delegates behavior to other instances of its own class. So, the composite pattern implements a specific kind of composition. Unlike other implementations of composition, then, the composite pattern is not properly characterized as having "no control over how [the] functionality is implemented".

Given the definition of the composite pattern, as distinct from the definition of composition, would you agree that the third option would better be stated as, "One drawback of composition is that it is not possible to change or customize the aggregated functionality"?

References:
en.wikipedia.org/wiki/Composite_pattern
c2.com/cgi/wiki?CompositePattern
en.wikipedia.org/wiki/Object_composition

Re: About Question enthuware.ocpjp.v7.2.1170 : Is the Compos

Posted: Fri May 30, 2014 12:08 pm
by admin
You are right. Fixed.
thank you for your feedback!
Paul.

Re: About Question enthuware.ocpjp.v7.2.1170 : Is the Compos

Posted: Fri May 30, 2014 12:14 pm
by telston
Thumbs up. Thank you, Paul.