I'm just studying the Builder pattern and do not understand the point of the Director.
http://en.wikipedia.org/wiki/Builder_pattern
Wouldn't just having Builder and their subclasses be sufficient?
Thanks
I'm just studying the Builder pattern and do not understand the point of the Director.
http://en.wikipedia.org/wiki/Builder_pattern
Wouldn't just having Builder and their subclasses be sufficient?
Thanks
The Builder exposes methods for making alterations to the item being produced. The Director holds the knowledge of which of these methods, for a given use, should be called, and in what order.
The Builder could be reused for multiple purposes, and contains knowledge of the internals of the product. The Director is used for a specific purpose, and contains knowledge of what the product needs to have to be used in the intended domain.