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
Why have we declared the instance reference volatile?
What is architecture and what is design?
What is the difference between proxy and adapter?
What are the main types of concurrency design patterns?
What is a lazy initialization in singleton?
What are the additional productivity features and enhancements included with Quartus II software version 6.0?
Can you explain singleton pattern?
What is the difference between architecture and design?
Are you using singleton in your code?
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 is viper architecture?
What is the prototype design pattern?
What are the SDLC phases you have invloved ?
What are the most popular design patterns?
What are the most commonly used design patterns?