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
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is abstraction in oop?
What is a class and object?
How do you define social class?
How oops is better than procedural?
What is object in oop?
What language is oop?
What is the main feature of oop?
What are the advantages of polymorphism?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
What is abstract class in oop?
What is the difference between inheritance and polymorphism?
write a C++ program for booking using constructor and destructor.
What is the real time example of encapsulation?
What does and I oop and sksksk mean?