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
About Question enthuware.ocpjp.v7.2.1170 : Is the Composite pattern on the exam?
Moderators: Site Manager, fjwalraven
-
- Posts: 4
- Joined: Wed May 21, 2014 8:44 am
- Contact:
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1170 : Is the Compos
You are right. Fixed.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 4
- Joined: Wed May 21, 2014 8:44 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1170 : Is the Compos
Thumbs up. Thank you, Paul.
Who is online
Users browsing this forum: No registered users and 28 guests