For the practical demonstration of SRP, I will provide you with a solid example using a GoF design pattern. The Decorator pattern is one of the structural design patterns that dynamically adds/overrides behavior in the existing method of an object. It allows functionality to be divided between classes with unique areas of concern, that is, single responsibility. The behavior can be added to an individual object either statically or dynamically without affecting the behavior of other objects from the same class.
Consider the following UML diagram:
The preceding figure ...