An open API service indexing awesome lists of open source software.

https://github.com/pingzidev/learningood

OOD Learning Notes 面向对象设计学习笔记(php demo)
https://github.com/pingzidev/learningood

ood ood-principles php

Last synced: 6 days ago
JSON representation

OOD Learning Notes 面向对象设计学习笔记(php demo)

Awesome Lists containing this project

README

          

面向对象设计学习笔记(php demo)
===

面向对象设计原则
---

| 缩写 | 英文名称 | 中文名称 |
|----------|:-------------:|------:|
| SRP | Single Responsibility Principle| 单一职责原则 |
| OCP | Open Close Principle| 开闭原则 |
| LSP | Liskov Substitution Principle| 里氏替换原则 |
| LoD | Law of Demeter ( Least Knowledge Principle)| 迪米特法则(最少知道原则) |
| ISP | Interface Segregation Principle| 接口分离原则 |
| DIP | Dependency Inversion Principle| 依赖倒置原则 |

代码示例
---
包含两部分:
- 1.面向对象设计原则定义
- 2.根据实际需求写的例子, BadXXX 代表不好的实现, GoodXXX代表较好的实现

参考
---
- [面向对象设计的六大设计原则(附 Demo & UML类图)
](https://juejin.im/post/5b9526c1e51d450e69731dc2)