Are SOLID principles really solid?
- by Arseny
The first pattern stands for this acronym is SRP. Here is a quote.
the single responsibility principle
states that every object should have a
single responsibility, and that
responsibility should be entirely
encapsulated by the class.
That's is simple and clear till we start to code ) Suppose we have a class with well defined SRP. To serialize this class instances we need to add special atrributes to that class. So now the class have other responsibility. Dosen't it violate SRP? Let's see other story. Interface implementation. Then we implement an interface we simply add other responsibility say dispose its resorces or compare its instances or whatever.
So my question. Is it possible to keep SRP complete? How can we do it?