有些內容使用中英雙語,有些只有英文或中文。歡迎使用與分享任何內容,但先來信告知並標示此部落格為出處。
Some parts use both Chinese and English, but some parts use only one language. Feel free to share, but please contact me first and list this blog as your reference.
顯示具有 Factory 標籤的文章。 顯示所有文章
顯示具有 Factory 標籤的文章。 顯示所有文章

2014年5月17日 星期六

Design Patterns 筆記 - Simple Factory Pattern 簡單工廠

初學Design Pattern,如有謬誤或超級大錯還請指教。

如不知道什麼是 Design Patterns,可先閱覽一下這篇:Design Patterns 筆記 - Overview
想知道其他種 Design Patterns,請看這篇:Design Patterns 筆記 - Categories 分類條列

另外,如果不懂Java的介面,可以參考這一篇:JAVA - 什麼是介面?
===================================

前述:

以下內容主要從 tutorialspoint 的 Design Patterns - Factory Pattern 翻譯而來。
在網站上只有單純寫 Factory Pattern,但依王者歸來:品味Java的21種設計模式中,
此篇應該是 Simple Factory Pattern 簡單工廠,嚴格而言不是標準的 Design Pattern,
在GoF中的著作沒有。(非 Factory Method 也不是 Abstract Factory)

另外,tutorialspoint 居然沒有Factory Method....之後我應該會找其他資料,再寫一篇