Question
Which of the following design patterns violates the
Open/Closed Principle of SOLID principles in object-oriented design?ÂSolution
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.
When was the idea of the Social Security Exchange floated in India?
Which of the following institutions/treaties are engaged in setting up of financial standards and regulations that influence the global financial system?
An anchor investor is one of the following:
Which of the following are the achievements after the budget of 2014-15 till 2023 - 2024?
- 47.8 crores PM Jana Dhan Accou...
Which of the following statements is/are correct in regards to the Economic survey of India 2022-23?
1.   The Government approved the sett...
Which of the following has been launched to strengthen the digital infrastructure of the country by the government of India?
1.   Governme...
As per the SEBI (International Financial Services Centres) Guidelines, 2015 the stock exchanges operating in IFSC may permit dealing in ______________ t...
Which is the biggest International Financial Services Centres in the globe?
Any alternative investment fund or mutual fund operating in IFSC shall accept money from eligible investors only in ____________________ as per the SEBI...
Who is the chairperson of the IFSCA?