바꿔서 재이용하기

 

* Adapter Pattern (= Wrapper Pattern)

  - 클라이언트는 Adapter 에게 Target inteface 를 통한 method 호출을 통해 요청을 한다

  - Adapter 는 Adaptee 인터페이스를 통해 요청을 하나 이상의 호출로 Adaptee 에게 옮긴다

  - 클라이언트는 결과를 받는다

 

* 의도

   - 서로 다른 인터페이스를 가진 클래스들이 통신하고 상호 작용할 수 있는 공통 개체를 만들어 함께 작동하도록 허용한다

(Class A - Adapter - Class B)

 

* 활용

   - 사용될 클래스가 인터페이스 요구사항을 충족하지 않을 때

 

* 디자인 원리

 

 

- Object Adapter = object composition + delegation

- Class Adapter = inheritance

'SW 공학 > ::: 패턴' 카테고리의 다른 글

///[GoF] Bridge Pattern  (0) 2021.09.27
///[GoF] Composite Pattern  (0) 2021.09.27
///[GoF] Decorator Pattern  (0) 2021.09.26
///[GoF] Singleton Pattern  (0) 2021.09.26
///[GoF] Builder Pattern  (0) 2021.09.26

+ Recent posts