patterns-discussion AT lists.siebelschool.illinois.edu
Subject: General talk about software patterns
List archive
RE: [patterns-discussion] Prototype and Composite/Decorator and B uilder for Composite
Chronological Thread
- From: Russell Dodd <rdodd AT hhh.co.uk>
- To: gang-of-4-patterns AT cs.uiuc.edu, patterns-discussion AT cs.uiuc.edu
- Subject: RE: [patterns-discussion] Prototype and Composite/Decorator and B uilder for Composite
- Date: Thu, 29 May 2003 10:07:04 +0100
- List-archive: <http://mail.cs.uiuc.edu/pipermail/patterns-discussion/>
- List-id: General talk about software patterns <patterns-discussion.cs.uiuc.edu>
Yves,
I don't know if this is of any help to you, but when our dev team
had a recent workshop where we discussed the Builder pattern, it
was mentioned that it may have been better to name the pattern
'Director', as it is the Director class that distinguishes this
pattern from the AbstractFactory pattern. The 'Builder' class does
not do the assembly, it is the 'Director' that does this.
Without the 'Director', the Builder pattern is just an
AbstractFactory pattern with an assembled product as output.
Just my thoughts,
Rus
-----Original Message-----
From: Yves Roy
[mailto:yvesroy_ AT sympatico.ca]
Sent: 28 May 2003 18:25
To:
gang-of-4-patterns AT cs.uiuc.edu;
patterns-discussion AT cs.uiuc.edu
Subject: [patterns-discussion] 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.
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 mailing list
patterns-discussion AT cs.uiuc.edu
http://mail.cs.uiuc.edu/mailman/listinfo/patterns-discussion
**********************************************************************
This email and any files sent with it are intended only for the named
recipient. If you are not the named recipient please telephone/email
the sender immediately. You should not disclose the content or
take/retain/distribute any copies.
**********************************************************************
- RE: [patterns-discussion] Prototype and Composite/Decorator and B uilder for Composite, Russell Dodd, 05/29/2003
Archive powered by MHonArc 2.6.16.