https://github.com/andyron/arphpdesignpatterns
https://github.com/andyron/arphpdesignpatterns
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/andyron/arphpdesignpatterns
- Owner: andyRon
- Created: 2024-04-30T04:24:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-30T04:30:10.000Z (about 1 year ago)
- Last Synced: 2025-01-21T15:24:04.508Z (4 months ago)
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP设计模式
---参考:https://laravelacademy.org/books/php-design-pattern
[DesignPatternsPHP](https://github.com/DesignPatternsPHP/DesignPatternsPHP)
https://learnku.com/docs/php-design-patterns/2018
## 概述
在软件工程中,设计模式(Design Pattern)是对软件设计中普遍存在(反复出现)的各种问题,所提出的解决方案。这个术语是由埃里希·伽玛(Erich Gamma)等人在1990年代从建筑设计领域引入到计算机科学的。
设计模式并不直接用来完成代码的编写,而是描述在各种不同情况下,要怎么解决问题的一种方案。面向对象设计模式通常以类或对象来描述其中的关系和相互作用,但不涉及用来完成应用程序的特定类或对象。设计模式能使不稳定依赖于相对稳定、具体依赖于相对抽象,避免会引起麻烦的紧耦合,以增强软件设计面对并适应变化的能力。
并非所有的软件模式都是设计模式,设计模式特指软件“设计”层次上的问题。还有其它非设计模式的模式,如架构模式。同时,算法不能算是一种设计模式,因为算法主要是用来解决计算上的问题,而非设计上的问题。
## 创建型
### 1 抽象工厂模式(Abstract Factory)