五種常見的 PHP 設計樣式 (design pattern)

「設計樣式」(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

發表回覆

  

  

  

您可使用下列 these HTML標籤

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>