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.
What is the purpose of the $500 million loan agreement between India and the Asian Development Bank (ADB)?
Which Indian state has the highest allocation for women-centric welfare schemes in FY25?
SEBI has slapped fines totalling ____ on 15 entities for indulging in non-genuine trades in the illiquid stock options segment on BSE.
In the event of the death of a subscriber under PMJJBY, who is eligible to receive the insurance payout?
What humanitarian aid did India dispatch to Jamaica in December 2024?
Which Indian state was named a Global Destination for 2025 by the Wall Street Journal?
Who established the Chandela dynasty in Jejakabhukti?
Recently the Union Minister Dr. Jitendra Singh inaugurate the “Jhula Bailey Suspension Bridge” in which of the following State/UT?
Which digital insurance platform, set for launch by IRDAI, is part of the Bima Trinity initiative?
World Health Organization (WHO) backs plan to turn which of the following city of Madhya Pradesh into a 'healthy city'?