Answer Posted / guest
A class can?t anticipate which kind of class of objects it
must create.
A class uses its subclasses to specify which objects it creates.
You want to localize the knowledge of which class gets created.
There are several similar variations on the factory pattern
to recognize.
1. The base class is abstract and the pattern must return a
complete working class.
2. The base class contains default methods and is only
subclassed for cases where the default methods are insufficient.
3. Parameters are passed to the factory telling it which of
several class types to return. In this case the classes may
share the same method names but may do something quite
different.
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is architecture and what is design?
What is the prototype design pattern?
Can we have this pattern implemented using static class?
When should design patterns be used?
what are the creational design patterns
What is the singleton design pattern?
Quartus II software version 6.0 is available for which operating systems (OS)?
What is singleton and factory pattern?
What are useful tools for developing and testing color schemes for web sites?
When singleton pattern is used?
What design pattern wrapper classes implement?
What are the examples of the behavioral design patterns?
What is the creational design pattern?
What is meant by design pattern?
What are the 23 design patterns?