「設計樣式」(design pattern) 這個概念最早是由軟件界「四大寇」(即 Erich Gamma, Richard Helm, Ralph Johnson, 和 John Vlissides)所撰寫的 Design Patterns 中提出,軟件開發者累積多年的經驗,知道在某些特定的情況下使用特定的技巧,可以得到最有效率和最好的結果,這些標準技巧就是所謂的「設計樣式」。
很多人多以為設計樣式只適用於 Java,其實其他編程語言也同樣適合,這些樣式只是一個設計,使用任何平台和編程語言來做實作都可以,Jack D Herrington 發表了一篇文章展示其中五種設計樣式在 PHP 中的應用:
- The Factory Pattern
- The Singleton Pattern
- The Observer Pattern
- The Chain-of-command Pattern
- The Strategy Pattern
相關文章
- 網站開發人員必備的 20 張速記片 (cheat sheet)
- PHP 開發人員比較喜歡以 Windows 為開發平台
- Google 教你優化 PHP,PHP 開發團隊指內容不確
- 認識 PHP 的 Hashing Functions
