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 abstraction in oop with example?
Why is abstraction used?
What is abstraction in oop?
Why do we use class?
What are oops methods?
What is property in oops?
What are the components of marker interface?
What is purpose of inheritance?
What is the fundamental idea of oop?
What is use of overloading?
What is difference between abstraction and encapsulation?
what are the realtime excercises in C++?
What is oops and its features?
What is encapsulation with real life example?
Is oop better than procedural?