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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.