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.
If ‘1x5629’ is a six digit number which is divisible by 9, then which of the following can be the minimum value of ‘x’?
What is the smallest perfect square that is divisible by each of 42, 48 and 60?
What are the last two digits of 56283 x 141283 × 125254?
What is the minimum value of X for which 437X6 is divisible by 9?
How many divisors does the number 5040 have?
Determine the remainder when 4412 is divided by 7?
When a number is divided by 8, the remainder is half of the divisor and the quotient is 3 more than twice the product of the divisor and remainder. Find...
Which of the following number is divisible by 8?
How many factors of 23 × 33 × 54 ×91× is divisible by 50 but not by 100?
Which of the following numbers is divisible by 22?