SOLID- Single Responsibility Principle

The Single Responsibility principle (SRP) states that:

There should never be more than one reason for a class to change.

We can relate the “reason to change” to “the responsibility of the class”. So each responsibility would be an axis for change. This principle is similar to designing classes which are highly cohesive. So the idea is to design a class which has one responsibility or in otherwords caters to implementing a functionality . I would like to clarify here that one responsibility doesnt mean that the class has only ONE method. A responsibility can be implemented by means of different methods in the class.

Read more

%d bloggers like this: