This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| design_pattern:bridge_pattern [2017/10/29 06:38] – ledyx | design_pattern:bridge_pattern [2021/02/07 03:25] (current) – [Bridge Pattern] ledyx | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| * 클래스 계층의 혼재와 분리 | * 클래스 계층의 혼재와 분리 | ||
| * <fc red> | * <fc red> | ||
| + | * 언제 쓰지? 장점? | ||
| + | * 예를 들어 어떤 프로그램을 배포하는데 각 OS별로 **의존(구현 계층)**하는 부분이 다른 경우 | ||
| + | * 기능 계층과 구현 계층 따로 확장이 가능하고, | ||
| - | {{tag> | + | {{tag> |
| = 기능의 클래스 계층 = | = 기능의 클래스 계층 = | ||
| Line 20: | Line 23: | ||
| public class Display { | public class Display { | ||
| - | private DisplayImpl impl; | + | private DisplayImpl impl; // 위임(떠넘기기). Loose Coupling. |
| public Display(DisplayImpl impl) { | public Display(DisplayImpl impl) { | ||