|
Design Pattern's Group Questions > Builder
|
|
|
| |
November 11th, 2006
|
Intent
Separate
the construction of a complex object from its representation so that the same
construction process can create different representations. -Design Patterns, GoF
Questions
1)
What is the role of the Director? Why is
it separate from the Builder?
2)
Do the build methods in the builder return anything?
3) Why
do there need to be multiple build methods in a Builder?
4)
What are the forces that would compel you to use a Builder?
5)
Before the Builder returns the final object, does it validate that it was built
sufficiently?
Examples – Which are Builders?
1) Email
message builder – Patterns in Java,
Mark Grand
Implement It!
You
are the lead programmer at a collection agency.
Your task is to create a delinquency notice (object), which could be
sent out up to 3 times to a person (depending on how delinquent they are!). The first notice should be nice, the second
firm but cordial, and the final downright nasty. The notice has 3 parts:
·
the
greeting, which takes a first and last name
·
the
message body, which takes the amount owed and the days delinquent
·
the
closing line, which takes nothing.
Implement
this using the Builder pattern. Is the
Builder appropriate here?
References
·
Builder Pattern (Wikipedia)
|
|
I'm currently living in Pittsburgh, PA, working as a Senior Technical Consultant for Summa, and just finished up my Masters degree in Philosophy. (thesis here!) My blog is mostly on understanding how to better analyze, make, and influence decisions in the world of enterprise software development. Subscribe here or write me at ben_northrop at yahoo dot com.
|
Warning: mysql_query() [function.mysql-query]: Access denied for user 'bennor2'@'localhost' (using password: NO) in /home/bennor2/public_html/includes/bottom.php on line 106
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/bennor2/public_html/includes/bottom.php on line 106
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/bennor2/public_html/includes/bottom.php on line 107
Comments ()
None so far!
|