橋樑模式

橋樑模式 定義 Decouple an abstraction from its implementation so that the two can vary independently. 將抽象和實現解耦,使得兩者可以獨立地變化; 分析 橋樑模式是一個指導如何設計類依賴關係的模式。A依賴B,爲了讓A和B都擁有可擴展性,A不應該依賴B的實現,而應該依賴B的抽象,也就是基於接口或者抽象類;A依賴B
相關文章
相關標籤/搜索