韌館-LearnHouse

Design Patterns (設計模式)

一年前我是剛出社會的菜鳥,主管跟我講到Design Patterns,那時,我對這名詞很陌生,所以聽完就忘了
一年後,主管又提到Design Patterns,很慚愧,我還是不太懂
但卻開始注意到設計模式這個名詞,一個系統要好維護,設計模式很重要
Survey後,覺得還是很抽象,可能程式看得不多,功力不夠,還是看不懂每種模式要表達的意思
所以只好遇到一種模式就在這記錄並學習,所以這篇文章會慢慢增長,一直到我遇到並了解下列不同的設計模式:

reference:http://www.sws.bfh.ch/~amrhein/ADP/HeadFirstDesignPatterns.pdf

生成模式 (Creational Patterns)
Abstract Factory、Builder、Factory Method、Prototype、Singleton

simple factoryReflection Factory

結構模式 (tructural Patterns)
Adapter、Bridge、Composite、Decorator、Facade、Flyweight、Proxy

行為模式 (Behavioral Patterns)
Chain of Responsibility、Command、Interpreter、Iterator、Mediator、Memento、Observer、State、Strategy、Template Method、Visitor

生成模式 (Creational Patterns)
結構模式 (tructural Patterns)
行為模式 (Behavioral Patterns)
Iterator:走訪聚合物件時,走訪與物件的實作要分開撰寫,毋須知曉聚合物件的內部細節,即可依序存取內含的每一個元素,也就是走訪只單純的印出結果值,並穩藏聚合物件的實作細節,優點是當商業邏機變更時,只要修改實作細節即可,而不需影響其他的程式。
參考範例:12

2013年1 月 posted by admin in 文獻參考 and have No Comments

Place your comment

Please fill your data and comment below.
名稱:
信箱:
網站:
您的評論: