This is a blog post with my personal vision on the subject of SoC (Separation of Concerns) and SRP (the Single Responsibility Principle).
First of all, I’m convinced that it’s very important to adhere to these principles as much as possible.
It can really make your code easier to read and maintain. Clean simple classes with one responsibility are usually much easier to understand and to change. A change in some part of the program, will only affect the class that is responsible for that part of the logic.
Read the excellent book “Head First Design Patterns” by Eric and Elisabeth Freeman, if you have no idea of what I mean.
On the other hand, it is my believe that a dogmatic approach can also make your project a mess. I’ve already seen such projects, where even the architect himself found it nearly impossible to find his way in the massive amount of classes.
(Yes, that logic is definitely in this class. No wait, it’s in another implementation of that same interface here, I think.
Now where is it? Oh right, it’s in one of the other projects. Hmm, let’s see. Which one could it be? I think here… hmmm….no…or here…)
This led me to the creation of following chart. Continue reading