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 the use of design patterns?
Can we use an equated value as operands for an MVC ? Reason for the same.
What is mvp design pattern?
What is the singleton design pattern?
Is oop a design pattern?
Why have we used synchronized here?
Which design pattern is mvc?
What are the design patterns you know explain?
Explain what is good design?
Why should we not use singleton pattern?
What is the factory pattern in the design pattern?
2. Create your own definition of a system. Based on the “system” definitions a. Identify your viewpoint of shortcomings in the definitions. b. Provide rationale as to why you believe that your definition overcomes those shortcomings. c. From an historical perspective, identify three precedented systems that were replaced by unprecedented systems.
What are useful tools for developing and testing color schemes for web sites?
What is the difference between factory and strategy design pattern?
Write the code for a singleton class?