728x90 반응형 SMALL adapterpattern1 [Design Pattern]Adapter Pattern이란? Adapter Pattern이란? 관계가 없는 인터페이스들이 같이 일할 수 있도록 도와주는 패턴이다. 두개의 인터페이스를 이어주는 인터페이스를 adapter라 한다. 예제public class Line { private int lines; public Line(int line) { this.lines = line; } public int GetLines() { return this.lines; } public int SetLines(int line) { this.lines = line; } } public class Station { public Line GetLine() { return new Line(1); } }Station클래스는 1호선만 다닐 수 있다. 하지만 4호선 9호선도 같이 다닐 수 있으.. 2019. 1. 18. 이전 1 다음 728x90 반응형 LIST