In what situation factory design patterns,DAO design
patterns,singleton design patterns should be applied.?
Answer Posted / monica
Use Factory Design Pattern when
- a class cannot anticipate the class of objects it must
create
- a class wants its subclasses to specify the objects it
creates
- classes delegate the responsibility to one of several
helper subclasses and you want to knowledge of which helper
subclass is the delegate.
Use Singleton Pattern when
- there must be one instance of a class and it must be
accessible to clients from well known access point.
-the sole instance should be extensible by subclassing, and
client should be able to use an extended instance without
modifying their code.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is polymorphism and why is it important?
What is polymorphism and example?
can inline function declare in private part of class?
What is meant by multiple inheritance?
What is new keyword in oops?
Write a program to sort the number with different sorts in one program ??
How oops is better than procedural?
Prepare me a program for the animation of train
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Is oop better than procedural?
What is pointer in oop?
What does no cap mean?
What is basic concept of oop?
What is object in oop with example?
write string class as your own class in java without using any built-in function