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 are the types of the proxy design you will get in the design pattern?
What are the benefits of the proxy in the design pattern?
What are the disadvantages of singleton pattern?
What are the examples of the behavioral design patterns?
What is mvp design pattern?
What is singleton design pattern in java?
What are the most commonly used design patterns?
5.Develop an entity relationships diagram that identifies physical entity relationships.
What are the additional productivity features and enhancements included with Quartus II software version 6.0?
What is the difference between proxy and adapter?
What is the creational design pattern?
What is use case in clean architecture?
What is the design pattern?
What are the most popular design patterns?
What is the factory pattern in the design pattern?