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)
- Host: GitHub
- URL: https://github.com/pingzidev/learningood
- Owner: PingziDev
- Created: 2019-04-03T14:01:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T15:31:21.000Z (about 7 years ago)
- Last Synced: 2025-11-30T23:23:26.334Z (6 months ago)
- Topics: ood, ood-principles, php
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README-zh.md
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)