June 2016
Beginner to intermediate
292 pages
6h 8m
English
The first principle of the SOLID stack is the Single Responsibility Principle. Following Martin's definition, the principle says:
A class should have only one reason to change.
The attribution of single responsibility leads to misunderstanding this principle. In fact it is often mistakenly taken to mean that a class should only do one thing. The definition of the principle, however, states that the only reason for which a class or object should be changed is because it has changed its responsibility. So, it is not true that an object can only do one thing, rather it can do more things that belong to the same responsibilities. In other words, the actions assigned to an object must be consistent with the unique ...
Read now
Unlock full access