94.3k views
5 votes
Why is the Singleton pattern commonly referred to as an “anti-pattern”?

1 Answer

2 votes

Answer:

Singleton pattern is the pattern for design that is build using the global variables which creates a lot of drawback in the designing. Singleton pattern are considered with the global variable and thus cannot be bound into single unit which complexes the components in design.

They have a loose coupled variables in design and also does not show the property of the multi-threading .These feature are responsible for the decrement in the performance and thus are not highly preferred choice for the pattern.So, it is known as the "anti- pattern".

User Igops
by
6.0k points