2011年1月9日 星期日

Factory Patterns : Factory Method and Abstract Factory

Factory pattern是一個關於創建物件的一種模式,將創建物建的過程抽象化,

並且將相關建立的資訊隱藏起來,並使得物件的初始化盡可能的與平台(系統)或其他物件組成關係為低相依性

(其實這邊是要講system independent)

  • Class creational patterns focus on the use of inheritance to decide the object to be instantiated --> Factory Method

  • Object creational patterns focus on the delegation of  the instantiation to another object --> Abstract Factory


 

沒有留言: