April 2015 Entries
The common architectural patterns are all pretty much the same. Layered architecture, MVC, Hexagonal architecture, Onion Architecture, Clean architecture… they all do two things: Define domains of responsibility Put functional dependencies in order Look at these depictions of some of the patterns: What you find are shapes (rectangles, circles) with the responsibility to produce part of the required behavior of a software. All models forsee certain responsibilities like interaction with the user, ......
When a module has a single responsibility that means it’s focused on producing the behavior of a single aspect. That’s how I described the Single Responsibility Principle (SRP) in my previous article. Since the SRP is so important and at the same time a bit elusive, I thought, I try to illustrate this “traits and aspects thing” a bit more. Maybe you can even develop a taste for the SRP :-) Look at this heap of sweets: Let them represent logic in your code. You know, those 5,000 lines of code in a ......
It’s equally important and mysterious: the Single Responsibility Principle (SRP). And even though its originator Robert C. Martin tried to explain it again, I feel there is something lacking. Some concreteness, some tangibility. First the definition of the SRP in Martin’s own words: “The Single Responsibility Principle (SRP) states that each software module should have one and only one reason to change.” This is more informative than Wikipedia’s tautology: “In object-oriented programming, the single ......