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 are the desirable attributes for memory managment?
why reinterpret cast is considered dangerous?
What is abstract class in oop?
What is oops in simple words?
write a C++ program for booking using constructor and destructor.
What does it mean when someone says I oop?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
Why we use classes in oop?
What is data binding in oops?
What is encapsulation and abstraction? How are they implemented in C++?
What is the benefit of oop?
What do you mean by abstraction?
Can we define a class within the interface?
Why do we use class in oops?
What is abstraction encapsulation?