> For the complete documentation index, see [llms.txt](https://kimtaesu.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kimtaesu.gitbook.io/workspace/undefined/14.2.-lsp-liskov-substitution-principle-1.md).

# 클린 코더스 강의 14.3. ISP(Interface Segregation Principle)

클라이언트가 자신이 이용하지 않는 메서드에 의존하지 않아야 한다는 원칙이다

![](/files/-LpLqAOv3XsBs81BQYNa)

Switch 는 Light 에 대한 의존성을 갖고 있다.&#x20;

Switch 는 Light 뿐만 아니라 Fan, Motor 등도 Turn On 할 수 있다.<br>

### Light 의존성 제거

![](/files/-LpLr7tQBa1NwPYFpRyu)

DIP 원칙에 따라 Switch 는 이제 Light 에 대한 의존성을 갖지 않는다.&#x20;

Switchable 의 이름은 Switch(Client) 에 이름을 따라야 한다.

## 나의 생각

ISP 는 상당히 구체적인 Case 를 설명하기 때문에 이해하기 쉽다. \
주의할 점은 사용하는 Naming 을 정할 때 사용하는 Client 에 이름을 따라야 한다.
