php-design-pattern icon indicating copy to clipboard operation
php-design-pattern copied to clipboard

歡迎收看設計模式大頭菜,設計模式大頭菜帶你找到屬於你的設計模式。

設計模式 Design Pattern

設計模式(Design Pattern)在軟體工程領域當中,是對於常見設計問題提出和總結了許多ㄎㄧㄤ到爆的解決方案,你可以想像成程式設計當中,所謂古人的智慧、老屁股的精髓,古有諾亞備份,現有設計模式大頭菜,大頭菜除了可以成為致富關鍵,還能夠成為你學習設計模式的好夥伴。

建立型 Creational

  • 單例模式 Singleton Pattern
  • 簡單工廠 Simple Factory
  • 靜態工廠 Static Factory
  • 抽象工廠 Abstract Factory
  • 工廠方法 Factory Method
  • 原型模式 Prototype Pattern
  • 建造者模式 Builder Pattern
  • 物件池模式 Pool Pattern

結構型 Structural

  • 轉接器模式 Adapter Pattern
  • 橋接模式 Bridge Pattern
  • 組合模式 Composite Pattern
  • 資料對應 Data Mapper
  • 修飾模式 Decorator Pattern
  • 依賴注入 Dependency Injection
  • 外觀模式 Facade Pattern
  • 流暢介面 Fluent Interface
  • 享元模式 Flyweight Pattern
  • 代理模式 Proxy Pattern
  • 註冊模式 Registry Pattern

行為型 Behavioral

  • 責任鏈模式 Chain of Responsibilities
  • 命令模式 Command Pattern
  • 疊代器模式 Iterator Pattern
  • 中介者模式 Mediator Pattern
  • 備忘錄模式 Memento Pattern
  • 空物件模式 Null Object Pattern
  • 觀察者模式 Observer Pattern
  • 規格模式 Specification Pattern
  • 狀態模式 State Pattern
  • 策略模式 Strategy Pattern
  • 模板方法 Template Method
  • 訪問者模式 Visitor Pattern

安裝 Installation

  1. 透過 composer 來安裝相關依賴。
$ composer install
  1. 輸入指令 phpunit 來執行測試。
$ ./vendor/bin/phpunit tests

參考文獻


技術部落格