Start learning 50% faster. Sign in now
The Singleton pattern violates the Open/Closed Principle of SOLID, which states that software entities (classes, modules, functions) should be open for extension but closed for modification. The Singleton pattern is designed to restrict the instantiation of a class to a single object. To achieve this, the class is tightly coupled to its own instance management logic, which means modifying or extending this behavior requires changes to the original class. As a result, Singleton classes are not easily extensible without modification, making them contrary to the Open/Closed Principle. Why Other Options are Incorrect: A) Strategy Pattern: The Strategy Pattern adheres to the Open/Closed Principle by allowing algorithms to be selected and applied at runtime without modifying existing code. C) Factory Method Pattern: This pattern promotes extensibility by allowing subclasses to alter the type of objects that will be created, without modifying the client code. D) Decorator Pattern: The Decorator Pattern is designed to extend functionality dynamically by wrapping objects, adhering to the Open/Closed Principle. E) Adapter Pattern: The Adapter Pattern allows for existing classes to be used without modification by adapting their interfaces to a new target interface, following the Open/Closed Principle.
Which of the following is not a potential use case for blockchain technology?
With reference to ‘Leptospirosis’, consider the following statements:
1.Leptospirosis is a contagious disease in animals but is occasionally ...
Consider the following statements about Defence Acquisition Council (DAC):
1. It is the highest decision-making body of the Defence Ministry on p...
Which state emerged as the top medalist in the inaugural Beach Games 2024 held in Diu?
Which planet is the brightest in our solar system?
'Mukhyamantri Ladli Behna Awas Yojana' has been launched in which state?
What is the name of the newly discovered ant species in the Western Ghats of India?
Who administers the oath for the office of the Vice-President of India?
Where was the Forum on China-Africa Cooperation (FOCAC) summit held recently?
Consider the following statements about Interest Equalisation Scheme:
1. It provides pre- and post-shipment export credit to exporters in rupee...