SRP
-
[SOLID] 단일 책임 원칙 (Single Responsibility Principle)Programming/CS 2021. 12. 14. 23:17
SOLID DESIGN PRINCIPLES 의 첫번째 원칙 : SINGLE RESPONSIBILITY (단일 책임 원칙) 컴퓨터의 프로그램에서의 Module, Class, Function은 하나의 역할만 수행해야 되는 원칙이다. 예시) Function int add(const int& num1, const int& num2) // 하나의 역할만 수행함 { return num1 + num2; } void printNum(const int& num) { std::cout