SRP 원칙은 클래스가 변경될 이유를 하나만 가져야 한다고 설명합니다.
Single Responsibility Principle(SRP)은 하나의 모듈이나 클래스가 변경될 이유를 하나만 가져야 한다고 설명합니다. 여러 책임을 가진 클래스는 여러 이유로 인해 수정될 수 있으며, 이는 다른 부분에 영향을 줄 위험이 있습니다. 따라서 관련된 변경 사항을 함께 그룹화하고 서로 다른 이유로 변경되는 부분은 분리해야 합니다. 작성된 예시는 이를 더 잘 이해할 수 있도록 도와줍니다.
The SRP principle states that a class should have only one reason to change.
The Single Responsibility Principle (SRP) explains that a module or class should have only one reason to change. A class mixing multiple concerns can be modified for several unrelated reasons, posing the risk of affecting other parts. Therefore, it is important to group related changes together and separate those that change for different reasons. The provided example helps clarify this concept.