Continue with your mobile number
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.
W.C. Bonnerjea was the president of the first session of congress. Then who was the president of the second session of the congress held at Kolkata.
The remains of an ancient civilization from around 4000 BC were discovered in:
Who gave the Title of “RAJA” to raja Ram Mohan Rai?
Which city hosted the G20 Agriculture Ministerial meeting from June 15 to 17, 2023?
With reference to the cultural history of India, the ‘'Kirtana-ghosha" was composed by:
In which year written examination for ICS started?
The Indus Valley Civilization script is:
Which of the following cities does not belong to the Indus Valley Civilization?
The Battle of Chausa was fought between which two historical figures?
Consider the followingpairs:
Whic...