Member-only story
Single Responsibility Principle
Hello Everyone,
Today I will give you information about the Single Responsibility Principle. Let’s start learning without losing time.
It is the approach adopted as the most important principle of design. In this approach, every responsibility is considered in a cause and effect relationship. To minimize the changes, each class is designed to assume only one responsibility. If a future change is to be made, we will need to make a change in the class that processes it. When we need to make a change in the classroom that does more work, the change may affect other functionality related to the other responsibility of the class. For this reason, each class must have only one responsibility. The Single Responsibility Principle is a simple and intuitive principle, but in practice it is sometimes difficult to do right. For example, it is necessary to make a careful decision about whether the multiplication or concatenation will not disrupt this principle.
Suppose we have an object to hold an e-mail message. A design was made using the IEPosta interface as in the example. The following use is a false example of the sole responsibility principle.