- 找出应用中可能需要变化之处,把它们独立出来, 不要和那些不需要变化的代码混在一起。
- 针对接口编程,而不是针对实现编程。
- 多用组合,少用继承。
- 为了交互对象之间的松耦合设计而努力。
- 类应该对扩展开放,对修改关闭。
- 要依赖抽象,不要依赖具体类。
- 最少知识原则:只和你的密友谈话。
- 一个类应该只有一个引起变化的原因。
-
Notifications
You must be signed in to change notification settings - Fork 0
Gavin80/design-patterns
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
design patterns demo
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published