Skip to content

Commit 27cc952

Browse files
author
lanyuanxiaoyao
committed
修改文件: _posts/2017-06-18-ocp.md
1 parent 94a213e commit 27cc952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2017-06-18-ocp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class Employee{
7070

7171
![][10]
7272

73-
![][11]
73+
![][11]
7474
*违反了替换原则,如果在testArea方法中传入了Square对象,那么结果将会是16,即使两个set方法调换,结果也是25,不会等于20,这就有了矛盾,这是因为长方形默认隐含了隐藏的客观条件——长宽独立变化,不互相影响*
7575
## 鸟都会飞吗
7676
![][12]
@@ -125,7 +125,7 @@ Bertrand Meyer 在 1988 年阐述了 LSP 原则与契约式设计之间的关系
125125

126126
![][19]
127127

128-
![][20]
128+
![][20]
129129
**有什么问题?**
130130

131131
# 依赖倒置原则(DIP)

0 commit comments

Comments
 (0)