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 encapsulation example?
What is balance factor?
What is abstraction with example?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
2. Give the different notations for the class.\
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is a class in oop?
Prepare me a program for the animation of train
What do you mean by variable?
What are the 4 main oop principles?
What is oops and why we use oops?
what is the sylabus for priliminaries?
What are the types of abstraction?
Why is abstraction used?
Are polymorphisms mutations?