### **1、設計模式概述**
在軟件工程中,設計模式(Design Pattern)是對軟件設計中普遍存在(反復出現)的各種問題,所提出的解決方案。這個術語是由埃里希·伽瑪(Erich Gamma)等人在1990年代從建筑設計領域引入到計算機科學的。
設計模式并不直接用來完成代碼的編寫,而是描述在各種不同情況下,要怎么解決問題的一種方案。面向對象設計模式通常以類或對象來描述其中的關系和相互作用,但不涉及用來完成應用程序的特定類或對象。設計模式能使不穩定依賴于相對穩定、具體依賴于相對抽象,避免會引起麻煩的緊耦合,以增強軟件設計面對并適應變化的能力。
并非所有的軟件模式都是設計模式,設計模式特指軟件“設計”層次上的問題。還有其它非設計模式的模式,如架構模式。同時,算法不能算是一種設計模式,因為算法主要是用來解決計算上的問題,而非設計上的問題。
本系列是常見設計模式的集合以及如何在 PHP 中實現這些設計模式,并為每種模式提供了相應的示例代碼。
很多人都知道設計模式,但并非都了解如何在具體應用中實現,基于此我們推出了這一系列教程。
### **2、常用設計模式大全**
設計模式可以按照結構被分成三種不同的類型:
#### **2.1 創建型**
在軟件工程中,創建型設計模式用于處理對象的實例化:
* [抽象工廠模式(Abstract Factory)](http://laravelacademy.org/post/2471.html)
* [建造者模式(Builder)](http://laravelacademy.org/post/2489.html)
* [工廠方法模式(Factory Method)](http://laravelacademy.org/post/2506.html)
* [多例模式(Multiton)](http://laravelacademy.org/post/2519.html)
* [對象池模式(Pool)](http://laravelacademy.org/post/2532.html)
* [原型模式(Prototype)](http://laravelacademy.org/post/2546.html)
* [簡單工廠模式(Simple Factory)](http://laravelacademy.org/post/2643.html)
* [單例模式(Singleton)](http://laravelacademy.org/post/2599.html)
* [靜態工廠模式(Static Factory)](http://laravelacademy.org/post/2647.html)
#### **2.2 結構型**
結構型設計模式用于處理類和對象的組合:
* [適配器模式(Adapter)](http://laravelacademy.org/post/2660.html)
* [橋梁模式(Bridge)](http://laravelacademy.org/post/2680.html)
* [組合模式(Composite)](http://laravelacademy.org/post/2699.html)
* [數據映射模式(Data Mapper)](http://laravelacademy.org/post/2739.html)
* [裝飾模式(Decorator)](http://laravelacademy.org/post/2760.html)
* [依賴注入模式(Dependency Injection)](http://laravelacademy.org/post/2792.html)
* [門面模式(Facade)](http://laravelacademy.org/post/2807.html)
* [流接口模式(Fluent Interface)](http://laravelacademy.org/post/2828.html)
* [代理模式(Proxy)](http://laravelacademy.org/post/2841.html)
* [注冊模式(Registry)](http://laravelacademy.org/post/2850.html)
#### **2.3 行為型**
行為型設計模式用于處理類的對象間通信:
* [責任鏈模式(Chain Of Responsibilities)](http://laravelacademy.org/post/2858.html)
* [命令行模式(Command)](http://laravelacademy.org/post/2871.html)
* [迭代器模式(Iterator)](http://laravelacademy.org/post/2882.html)
* [中介者模式(Mediator)](http://laravelacademy.org/post/2894.html)
* [備忘錄模式(Memento)](http://laravelacademy.org/post/2903.html)
* [空對象模式(Null Object)](http://laravelacademy.org/post/2912.html)
* [觀察者模式(Observer)](http://laravelacademy.org/post/2935.html)
* [規格模式(Specification)](http://laravelacademy.org/post/2960.html)
* [狀態模式(State)](http://laravelacademy.org/post/2971.html)
* [策略模式(Strategy)](http://laravelacademy.org/post/2990.html)
* [模板方法模式(Template Method)](http://laravelacademy.org/post/3006.html)
* [訪問者模式(Visitor)](http://laravelacademy.org/post/3024.html)
#### **2.4?其它**
* [委托模式(Delegation)](http://laravelacademy.org/post/3038.html)
* [服務定位器模式(Service Locator)](http://laravelacademy.org/post/2820.html)
* [資源庫模式(Repository)](http://laravelacademy.org/post/3053.html)
- 前言
- php
- 設計模式
- 代碼安全
- 性能測試
- 自動化測試
- 項目質量
- 自動化部署
- 掌握框架
- laravel5.8
- laravel聲明周期
- mysql
- 物理文件組成
- 存儲引擎和優化
- 權限和安全
- 備份和恢復
- 查詢優化
- 索引優化
- 主從架構
- 監測工具
- redis
- redis簡介
- redis存儲
- windows下 php7.3+redis3 安裝
- 參數配置說明
- redis 數據類型
- 緩存穿透和緩存雪崩問題
- redis并發競爭key問題
- thinkphp5+redis+mysql搶票示例
- apache
- nginx
- Nginx服務器的安裝部署
- Nginx服務器架構
- Nginx服務器的高級配置
- Nginx服務器的Rewrite功能
- Nginx服務器的代理服務
- Nginx服務器的緩存機制
- Nginx源碼結構
- Nginx基本數據結構
- 微服務
- 分布式
- 前后端分離解決方案
- 服務端實現
- thinkphp5
- laravel5
- 客戶端實現H5
- vue.js
- element-ui
- vue-cli
- 客戶端APP
- 客戶端小程序
- 代碼自動生成
- 商城項目實戰
- 系統架構