摘要: Layering & Contract Philosophy With additional indirection 1 class CComponent 2 { 3 public: virtual void Operation() = 0; 4 public: virtual void AddComponent(Component* p)= 0; 5 public: virtual void RemoveComponent(Component* p)= 0; 6 public: virtual Component* GetChild... 阅读全文
posted @ 2013-08-19 18:48 iDragon 阅读(306) 评论(0) 推荐(0)
摘要: Layering & Contract Philosophy With additional indirection. 1 class CWindowImp 2 { 3 public: virtual void DrawLine(){}; 4 public: virtual void DrawText(){}; 5 } 6 class CWindow 7 { 8 public: virtual void DrawLine(){}; 9 virtual void DrawText(){};10 protect:... 阅读全文
posted @ 2013-08-19 18:40 iDragon 阅读(277) 评论(0) 推荐(0)
摘要: Layering & Contract Philosophy With additional indirectionAdaptee object just is as a member. Adaptee object just relies on Adapter object.class CAdaptee{ public: void theExistingAndIncompatibleMethod(){ … } ;}class CTarget{ public: virtual void theNewMethod() = 0;}class CAdapter: public CT... 阅读全文
posted @ 2013-08-19 18:33 iDragon 阅读(197) 评论(0) 推荐(0)
摘要: Layering & Contract Philosophy With additional indirectionclass CSingleton{ Protect: CSingleton(); Protect: CSingleton(const CSingleton&); Protect: CSingleton& operator=(const CSingleton& rhs); Private: ~CSingleton(); Private: static CSingleton *pInstance; Public: static CSin... 阅读全文
posted @ 2013-08-19 18:26 iDragon 阅读(195) 评论(0) 推荐(0)