samedi 19 avril 2014

Why singleton classes cannot be sub-classed?


Vote count:

0




I was going through the negative effects of singleton. Here is one of the point that I cannot understand at all. Here is the link and the point.



Negative sides of Singleton

The following points are used against the Singleton pattern:

They deviate from the Single Responsibility Principle. A singleton class has the responsibility to create an instance of itself along with other business responsibilities. However, this issue can be solved by delegating the creation part to a factory object.
Singleton classes cannot be sub classed.


http://ift.tt/1f7yXbn



asked 15 secs ago






Aucun commentaire:

Enregistrer un commentaire