SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Builder
|
|
Director
|
|
Manager
|
|
CareerBuilder
|
Detailed explanation-1: -The director class defines the order in which to execute the building steps, while the builder provides the implementation for those steps. The director knows which building steps to execute to get a working product. Having a director class in your program isn’t strictly necessary.
Detailed explanation-2: -In the builder: A build() method which calls the method, passing in each field. It returns the same type that the target returns. In the builder: A sensible toString() implementation. In the class containing the target: A builder() method, which creates a new instance of the builder.
Detailed explanation-3: -UML class and sequence diagram Instead, the Director refers to the Builder interface for building (creating and assembling) the parts of a complex object, which makes the Director independent of which concrete classes are instantiated (which representation is created).
Detailed explanation-4: -The algorithm for creating a complex object should be independent of the parts that make up the object, and how they’re assembled. The construction process must allow different representations for the object that’s constructed.