개발/개념
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcFOOvc%2FbtswbBomrYB%2FMbwV9KWr8ayfsj1LjmkMu0%2Fimg.png)
[객체지향] SOLID 예제(5) - 인터페이스 분리의 원칙(ISP)
interface IPerson { wakeUp(): void; bathroomActivity(): void; } class Person implements IPerson { private bathroom: IBathroom; constructor(bathroom: IBathroom) { this.bathroom = bathroom; } wakeUp() { console.log('아침에 일어난다.'); } bathroomActivity() { this.bathroom.goToBathroom(); this.bathroom.washFace(); this.bathroom.brushTeeth(); this.bathroom.washHair(); this.bathroom.dryOff(); this.bathroom...
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdbOJ6%2Fbtsv8SJPXoQ%2F1k04jZWkgteg7xa5smKJp0%2Fimg.png)
[객체지향] SOLID 예제(4) - 리스코프 치환의 원칙(LSP)
interface IPerson { wakeUp(): void; bathroomActivity(): void; } class Person implements IPerson { private bathroom: IBathroom; constructor(bathroom: IBathroom) { this.bathroom = bathroom; } wakeUp() { console.log('아침에 일어난다.'); } bathroomActivity() { this.bathroom.goToBathroom(); this.bathroom.washFace(); this.bathroom.brushTeeth(); this.bathroom.washHair(); this.bathroom.dryOff(); this.bathroom...
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FrIh6B%2FbtsvHbCIinK%2FgHg7eWW6EfdJMWsxEfd6R1%2Fimg.png)
[객체지향] SOLID 예제(3) - 개방-폐쇄의 원칙(OCP)
class Person { private bathroom: Bathroom; constructor(bathroom: Bathroom) { this.bathroom = bathroom; } wakeUp() { console.log('아침에 일어난다.'); } bathroomActivity() { this.bathroom.goToBathroom(); this.bathroom.washFace(); this.bathroom.brushTeeth(); this.bathroom.washHair(); this.bathroom.dryOff(); this.bathroom.leaveBathroom(); } } class Bathroom { goToBathroom() { console.log('화장실로 간다.'); } was..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FSFbZG%2FbtsvM11mLFy%2FWC97FUUrIrKxr6o18Wyzk0%2Fimg.png)
[객체지향] SOLID 예제(2) - 의존성 역전의 원칙(DIP)
class Person { private bathroom: Bathroom; constructor() { this.bathroom = new Bathroom(); } wakeUp() { console.log('아침에 일어난다.'); } bathroomActivity() { this.bathroom.goToBathroom(); this.bathroom.washFace(); this.bathroom.brushTeeth(); this.bathroom.washHair(); this.bathroom.dryOff(); this.bathroom.leaveBathroom(); } } class Bathroom { goToBathroom() { console.log('화장실로 간다.'); } washFace() { co..