Adapter Pattern1 adapter pattern adapter pattern 1.소스 #include using namespace std; typedef int Coordinate; typedef int Dimension; // Desired interface class Rectangle { public: virtual void draw() = 0; }; // Legacy component class LegacyRectangle { public: LegacyRectangle(Coordinate x1, Coordinate y1, Coordinate x2, Coordinate y2) { x1_ = x1; y1_ = y1; x2_ = x2; y2_ = y2; cout 2016. 7. 14. 이전 1 다음