patterns-discussion AT lists.siebelschool.illinois.edu
Subject: General talk about software patterns
List archive
[patterns-discussion] Prototype and Composite/Decorator and Builder for Composite
Chronological Thread
- From: Yves Roy <yvesroy_ AT sympatico.ca>
- To: "gang-of-4-patterns AT cs.uiuc.edu" <gang-of-4-patterns AT cs.uiuc.edu>, "patterns-discussion AT cs.uiuc.edu" <patterns-discussion AT cs.uiuc.edu>
- Subject: [patterns-discussion] Prototype and Composite/Decorator and Builder for Composite
- Date: Wed, 28 May 2003 10:24:42 -0700
- List-archive: <http://mail.cs.uiuc.edu/pipermail/patterns-discussion/>
- List-id: General talk about software patterns <patterns-discussion.cs.uiuc.edu>
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.
2) The Related Patterns section of the Builder (p. 106) says that a
Composite is what the builder often builds. Fine enough for "simple"
composites (where parts are simply appended to the composite, as in the
RTF example given in the book).
But I do not quite see how a builder can build a tree structure such as
parse trees, which are built bottom-up. The description given in the
book (Implementation section, p. 101) of how this is achieved doesn't
help me much:
"[...] the builder would return child nodes to the director, which then
would pass them back to the builder to build the parent nodes".
Again, a simple C++ example illustrating that last procedure would be
helpful.
Thanks
Yves
- [patterns-discussion] Prototype and Composite/Decorator and Builder for Composite, Yves Roy, 05/28/2003
- Re: [patterns-discussion] Prototype and Composite/Decorator and Builder for Composite, Ray Tayek, 05/28/2003
- Re: [patterns-discussion] Prototype and Composite/Decorator and Builder for Composite, Andrew Chelyabin, 05/29/2003
Archive powered by MHonArc 2.6.16.