設計模式 之 《觀察者模式 (Observer)》

      #ifndef __OBSERVER_MODEL__ #define __OBSERVER_MODEL__ #include <string> #include <iostream> #include <vector> using namespace std; /* GOOD:定義了一種一對多的關係,讓多個觀察對象(公司員工)同時監聽一個主題對象(祕書), 主題對象狀態發生變化時,
相關文章
相關標籤/搜索