Definition: There should never be more than one reason for a class to change
There is three separate responsibilities then we should have three separate classes of modules
Whenever you're designing a class or module you should take care that class is addressing only a specific concern so that when a change is needed there is only one reason for a particular class to change.
Definition: Software entities(classes, modules, methods etc.) should be open for extension, but closed for modification.
Open for Extension:
Closed for Modification:
If the Base Class that is already written and tested needs to extend or modify behavior of one of the methods that is written in this class, then use inheritance and override the method.
Definition: We should be able to substitute base class objects with child class objects and this should not alter behavior/characteristics of program.
Definition: Clients should not be forced to depend upon interfaces that they do not use.
Definition - 1: High level modules should not depend upon low level modules. Both should depend upon abstractions.
Definition - 2: Abstractions should not depend upon details. Details should depend upon abstractions.
Instead of instantiating dependencies ourselves let somebody else give us the dependencies.