Are SOLID principles really solid?

Posted by Arseny on Stack Overflow See other posts from Stack Overflow or by Arseny
Published on 2010-06-08T14:01:09Z Indexed on 2010/06/08 14:12 UTC
Read the original article Hit count: 428

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET