Question
Which design pattern is best suited for managing the
creation of objects without specifying their concrete classes?Solution
The Factory Pattern is a creational design pattern that provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created. It abstracts the instantiation process, enabling flexibility and scalability in object creation. For instance, in a GUI framework, the factory method might create different types of buttons (WindowsButton, MacButton) depending on the operating system. By decoupling the client code from concrete classes, this pattern promotes adherence to the Open/Closed Principle of SOLID. Why Other Options Are Incorrect :
- Singleton Pattern : This ensures a class has only one instance and provides global access to it, unrelated to flexible object creation.
- Observer Pattern : This defines a one-to-many dependency, where changes in one object are notified to multiple observers.
- Adapter Pattern : This works as a bridge between incompatible interfaces, not for object creation.
- Decorator Pattern : This adds functionality dynamically to objects, without modifying their structure.
By which of the following processes water enter into seed coat first when a dry seed is placed in a suitable medium for germination?
Where is the chemical weathering of rocks is most intense ?
A true fruit is developed:
What will be the base period of crop if duty of water is 1200 ha/cumec and depth of water is 50cm?Â
Deficiency of which essential plant nutrient leads to ‘pop pod in groundnut’:
Which of the following is a measure to promote agricultural exports under the Agricultural Export Policy?
What percentage of water-soluble K2O is present in Muriate Of Potash?
The Central Seed Testing Laboratory is located at:
Triple test cross is an extension of:
Which method is most suitable for the plantation of fruit trees in slopy areas?