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
Explain three types of components comprise an application design?
What is factory method in design pattern?
Can we inherit singleton class?
What are the SDLC phases you have invloved ?
Can we make the reference instance non static?
What are the design patterns you know explain?
Which design pattern is mostly used in net?
When singleton pattern is used?
What are the disadvantages of singleton pattern?
Are you using singleton in your code?
What are the 23 design patterns?
What is the creational design pattern?
what are the creational design patterns
What is singleton design pattern in java?
What is the difference between adapter and facade?