- Encapsulate what varies
- Favor composition over inheritance
- Program to interfaces, not implementations
- Strive from loosely coupled designs between objects that interacts
- Classes should be open for extension but close to modification
- Depend on abstraction. Don't depend on concrete classes
OO Principles
最新推荐文章于 2021-02-01 10:42:07 发布