1

I have just read about Singleton Pattern's drawbacks. One of the drawbacks is Singleton Pattern violates Single Responsibility Principle, because of policing the instances of itself and providing configuration information.

And I wonder, do every Class in java violate Single Responsibility Principle? because A Class is a sub-class of Object class and object class provide some default methods such as equals, toString, hashCode. and this class also provide its own operation.

Tran Thien Chien
  • 643
  • 2
  • 6
  • 17
  • Does it really matter? The reality is that that is how Java works, so you have no choice. – Oliver Charlesworth Apr 19 '16 at 09:06
  • Nevertheless I find this question valid. Maybe you can't change Java but it's still worth to think about it as it gives insight in software architecture. – Timmos Apr 19 '16 at 09:07

0 Answers0