gang-of-4-patterns AT lists.siebelschool.illinois.edu
Subject: Design Patterns discussion
List archive
RE : [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite
Chronological Thread
- From: "Mikal Ziane" <Mikal.Ziane AT lip6.fr>
- To: "'Yves Roy'" <yvesroy_ AT sympatico.ca>, <gang-of-4-patterns AT cs.uiuc.edu>, <patterns-discussion AT cs.uiuc.edu>
- Subject: RE : [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite
- Date: Wed, 28 May 2003 19:13:02 +0200
- Importance: Normal
- List-archive: <http://mail.cs.uiuc.edu/pipermail/gang-of-4-patterns/>
- List-id: Design Patterns discussion <gang-of-4-patterns.cs.uiuc.edu>
I guess that if class Client wants to use some methods of classes A1... An
uniformly (hypothesis of Composite) then it is natural that class Client use
"new" uniformly too and hence rely on Prototype.
It is not necessary if the goal is simply to use specific methods uniformly
(e.g. "draw") to hide the loop involved by calling the method on parts of a
composite (e.g. drawing a figure involves drawing its parts).
But if the goal is to decouple class Client from the existence of classes A1
... An (which implies using all their operations uniformly including "new")
then a creational pattern like Prototype of Factory Method is useful if not
necessary.
-----Message d'origine-----
De :
gang-of-4-patterns-admin AT cs.uiuc.edu
[mailto:gang-of-4-patterns-admin AT cs.uiuc.edu]
De la part de Yves Roy
Envoyé : mercredi 28 mai 2003 19:25
À :
gang-of-4-patterns AT cs.uiuc.edu;
patterns-discussion AT cs.uiuc.edu
Objet : [gang-of-4-patterns] Prototype and Composite/Decorator and Builder
for Composite
Dear suscribers:
I have 2 clear and simple questions:
1) The GOF book mentions in the Related Patterns section of Prototype
pattern (p. 126) that "Design that make heavy use of the Composite and
Decorator patterns often can benefit from Prototype as well".
My question is, how, exactly? Any simple C++ examples illustrating would
be welcome.
tinfo/gang-of-4-patterns
- [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite, Yves Roy, 05/28/2003
- Re: [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite, Robert Allan Schwartz, 05/28/2003
- RE : [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite, Mikal Ziane, 05/28/2003
- [gang-of-4-patterns] Re: [patterns-discussion] Prototype and Composite/Decorator and Builder for Composite, Ray Tayek, 05/28/2003
- Re: [gang-of-4-patterns] Prototype and Composite/Decorator and Builder for Composite, foxgem, 05/29/2003
Archive powered by MHonArc 2.6.16.