- 객체 지향 프로그래밍 및 설계를 할 때 지켜야 하는 5가지 기본 원칙.
- 시간이 지나도 유지 보수와 확장이 쉬운 시스템을 만들때 적용.
단일 책임 원칙 (Single Responsibility Principle)
- 한 클래스는 하나의 기능만 가지며, 클래스가 제공하는 모든 서비스는 그 하나의 책임을 수행하는데 집중되어 있어야 한다는 원칙.
개방폐쇄의 원칙 (Open Close Principle)
- 확장에는 열려있고, 변경에는 닫혀있어야 한다는 원칙.
리스코브 치환의 원칙 (The Liskov Substitution Principle)
- 서브 타입은 언제나 기반 타입으로 교체할 수 있어야 한다.
인터페이스 분리의 원칙 (Interface Segregation Principle)
- 자신이 사용하지 않는 인터페이스는 구현하지 말아야 한다.
의존성역전의 원칙 (Dependency Inversion Principle)
- 하위 레벨 모듈의 변경이 상위 레벨 모듈의 변경을 요구하는 위계관계를 끊는 의미의 역전.
- 실제 사용 관계는 바뀌지 않으며, 추상을 매개로 메시지를 주고 받음으로써 관계를 최대한 느슨하게 만드는 원칙.