第一篇博文简单介绍面向对象设计,用来告诫自己以后规范编码,编写有质量的代码。
参考博文:S.O.L.I.D:The First 5 Principles of Object Oriented Design
S.O.L.I.D:面向对象设计的5 大原则
Overview
Initial |
Stands for |
Concept |
S |
SRP |
Single responsibility principle “A class should have only one reason to change.“ |
O |
OCP |
Open/Closed principle ''software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification'' |
L |
LSP |
Liskov substitution principle ''objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” |
I |
ISP |
Inrerface segregation principle ''many client-specific interfaces are better than one general-purpose interface.'' |
D |
DIP |
Dependency inversion principle ''one should “Depend upon Abstractions. Do not depend upon concretions. |