10000 change place · sockstack/design-patterns-by-php@626c4c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 626c4c3

Browse files
committed
change place
1 parent 3e5221a commit 626c4c3

31 files changed

+71
-71
lines changed

.DS_Store

2 KB
Binary file not shown.

files/.DS_Store

8 KB
Binary file not shown.

chapter1.md renamed to files/chapter1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ echo $operation->getResult()."\n";
112112
113113
> 高内聚,低耦合
114114
115-
下一章:[第二章 商场促销 --- 策略模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter2.md)
115+
下一章:[第二章 商场促销 --- 策略模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter2.md)

chapter10.md renamed to files/chapter10.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ $student2->TestQuestion3();
105105
106106
> 当不变的和可变的行为在方法的子类实现中混合在一起的时候,不变的行为就会在子类中重复出现。通过模版方法把这些行为搬移到单一的地方,这样就帮助子类摆脱重复的不变行为的纠缠。
107107
108-
上一章:[第九章 简历复印 --- 原型模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter9.md)
108+
上一章:[第九章 简历复印 --- 原型模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter9.md)
109109

110-
下一章:[第十一章 无熟人难办事 --- 迪米特法则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter11.md)
110+
下一章:[第十一章 无熟人难办事 --- 迪米特法则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter11.md)

chapter11.md renamed to files/chapter11.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
> 类之间的耦合越弱,越有利于复用,一个处在弱耦合的类被修改,不会对有关系的类造成波及。
1010
1111

12-
上一章:[第十章 考题抄错会做也白搭 --- 模版方法模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter10.md)
12+
上一章:[第十章 考题抄错会做也白搭 --- 模版方法模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter10.md)
1313

14-
下一章:[第十二章 牛市股票还会亏钱 --- 外观模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter12.md)
14+
下一章:[第十二章 牛市股票还会亏钱 --- 外观模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter12.md)

chapter12.md renamed to files/chapter12.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ $facade->methodB();
8585
8686
> 首先,在设计初期阶段,应该要有意识的将不同的两个层分离,层与层之间建立外观Facade;其次,在开发阶段,子系统往往因为不断的重构演化而变得越来越复杂,增加外观Facade可以提供一个简单的接口,减少它们之间的依赖;另外在维护一个遗留的大型系统时,可能这个系统已经非常难以维护和扩展了,为新系统开发一个外观Facade类,来提供设计粗糙或高度复杂的遗留代码的比较清晰简单的接口,让系统与Facade对象交互,Facade与遗留代码交互所有复杂的工作
8787
88-
上一章:[第十一章 无熟人难办事 --- 迪米特法则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter11.md)
88+
上一章:[第十一章 无熟人难办事 --- 迪米特法则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter11.md)
8989

90-
下一章:[第十三章 好菜每回味不同 --- 建造者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter13.md)
90+
下一章:[第十三章 好菜每回味不同 --- 建造者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter13.md)

chapter13.md renamed to files/chapter13.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ $fatDirector->CreatePerson();
122122
123123
> 建造者模式是在当创建复杂对象的算法应该独立于改对象的组成部分以及它们的装配方式时适用的模式。
124124
125-
上一章:[第十二章 牛市股票还会亏钱 --- 外观模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter12.md)
125+
上一章:[第十二章 牛市股票还会亏钱 --- 外观模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter12.md)
126126

127-
下一章:[第十四章 老板回来,我不知道 --- 观察者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter14.md)
127+
下一章:[第十四章 老板回来,我不知道 --- 观察者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter14.md)

chapter14.md renamed to files/chapter14.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ $s->notify();
8282
8383
> 观察者模式所做的工作其实就是在接触耦合。让耦合的双方都依赖于抽象,而不是依赖于具体。从而使得各自的变化都不会影响另一边的变化。
8484
85-
上一章:[第十三章 好菜每回味不同 --- 建造者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter13.md)
85+
上一章:[第十三章 好菜每回味不同 --- 建造者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter13.md)
8686

87-
下一章:[第十五章 就不能不换DB吗? --- 抽象工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter15.md)
87+
下一章:[第十五章 就不能不换DB吗? --- 抽象工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter15.md)

chapter15.md renamed to files/chapter15.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,6 @@ $id->getDepartment(1);
207207
208208
> 所有在用简单工厂的地方,都可以考虑用反射技术来去除switch或if,解除分支判断代码的耦合。
209209
210-
上一章:[第十四章 老板回来,我不知道 --- 观察者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter14.md)
210+
上一章:[第十四章 老板回来,我不知道 --- 观察者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter14.md)
211211

212-
下一章:[第十六章 无尽加班何时休 --- 状态模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter16.md)
212+
下一章:[第十六章 无尽加班何时休 --- 状态模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter16.md)

chapter16.md renamed to files/chapter16.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,6 @@ $emergencyProjects->WriteProgram();
165165
> 当一个对象的行为取决于它的状态,并且它必须在运行时刻根据状态改变它的行为时,就可以考虑使用状态模式了。
166166
167167

168-
上一章:[第十五章 就不能不换DB吗? --- 抽象工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter15.md)
168+
上一章:[第十五章 就不能不换DB吗? --- 抽象工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter15.md)
169169

170-
下一章:[第十七章 在NBA我需要翻译 --- 适配器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter17.md)
170+
下一章:[第十七章 在NBA我需要翻译 --- 适配器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter17.md)

chapter17.md renamed to files/chapter17.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ $translator->Defense();
115115
116116
> 在双方都不太容易修改的时候再使用适配器模式适配。
117117
118-
上一章:[第十六章 无尽加班何时休 --- 状态模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter16.md)
118+
上一章:[第十六章 无尽加班何时休 --- 状态模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter16.md)
119119

120-
下一章:[第十八章 如果再回到从前 --- 备忘录模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter18.md)
120+
下一章:[第十八章 如果再回到从前 --- 备忘录模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter18.md)

chapter18.md renamed to files/chapter18.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ $o->show();
101101
> 使用备忘录可以把复杂的对象内部信息对其他的对象屏蔽起来。
102102
103103

104-
上一章:[第十七章 在NBA我需要翻译 --- 适配器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter17.md)
104+
上一章:[第十七章 在NBA我需要翻译 --- 适配器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter17.md)
105105

106-
下一章:[第十九章 分公司 = 一部分 --- 组合模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter19.md)
106+
下一章:[第十九章 分公司 = 一部分 --- 组合模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter19.md)

chapter19.md renamed to files/chapter19.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ $root->display(1);
110110
111111
> 组合模式可以让客户一致地使用组合结构和单个对象。
112112
113-
上一章:[第十八章 如果再回到从前 --- 备忘录模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter18.md)
113+
上一章:[第十八章 如果再回到从前 --- 备忘录模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter18.md)
114114

115-
下一章:[第二十章 想走?可以!先买票 --- 迭代器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter20.md)
115+
下一章:[第二十章 想走?可以!先买票 --- 迭代器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter20.md)

chapter2.md renamed to files/chapter2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ $context->contextInterface();
127127
128128
> 在基本的策略模式中,选择所用具体实现的职责由客户端对象承担,并转给策略模式的Context对象。
129129
130-
上一章:[第一章 代码无错就是优 ---简单工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter1.md)
130+
上一章:[第一章 代码无错就是优 ---简单工厂模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter1.md)
131131

132-
下一章:[第三章 拍摄UFO --- 单一职责原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter3.md)
132+
下一章:[第三章 拍摄UFO --- 单一职责原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter3.md)

chapter20.md renamed to files/chapter20.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ while (!$i->isDone())
109109
> 迭代器模式就是分离了集合对象的遍历行为,抽象出一个迭代器类来负责,这样既可以做到不暴露集合内部的结构,又可让外部代码透明地访问集合内部的数据。
110110
111111

112-
上一章:[第十九章 分公司 = 一部分 --- 组合模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter19.md)
112+
上一章:[第十九章 分公司 = 一部分 --- 组合模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter19.md)
113113

114-
下一章:[第二十一章 有些类也需要计划生育 --- 单例模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter21.md)
114+
下一章:[第二十一章 有些类也需要计划生育 --- 单例模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter21.md)

chapter21.md renamed to files/chapter21.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ if ($s1 == $s2)
3838
> 单例模式因为Singleton类封装它的唯一实例,这样它可以严格地控制客户怎样访问以及何时访问它。简单地说就是对唯一实例的受控访问。
3939
4040

41-
上一章:[第二十章 想走?可以!先买票 --- 迭代器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter20.md)
41+
上一章:[第二十章 想走?可以!先买票 --- 迭代器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter20.md)
4242

43-
下一章:[第二十二章 手机软件何时统一 --- 桥接模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter22.md)
43+
下一章:[第二十二章 手机软件何时统一 --- 桥接模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter22.md)

chapter22.md renamed to files/chapter22.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,6 @@ $ab->run();
9595
9696
> 只要真正深入地理解了设计原则,很多设计模式其实就是原则的应用而已,或许在不知不觉中就在使用设计模式了。
9797
98-
上一章:[第二十一章 有些类也需要计划生育 --- 单例模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter21.md)
98+
上一章:[第二十一章 有些类也需要计划生育 --- 单例模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter21.md)
9999

100-
下一章:[第二十三章 烤羊肉串引来的思考 --- 命令模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter23.md)
100+
下一章:[第二十三章 烤羊肉串引来的思考 --- 命令模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter23.md)

chapter23.md renamed to files/chapter23.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ $girl->notify();
104104
105105
> 敏捷开发原则告诉我们,不要为代码添加基于猜测的、实际不需要的功能。如果不清楚一个系统是否需要命令模式,一般酒不要急着去实现它,事实上,在需要的时候通过重构实现这个模式并不难,只有在真正需要如撤销/恢复操作等功能时,把原来的代码重构为命令模式才有意义。
106106
107-
上一章:[第二十二章 手机软件何时统一 --- 桥接模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter22.md)
107+
上一章:[第二十二章 手机软件何时统一 --- 桥接模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter22.md)
108108

109-
下一章:[第二十四章 加薪非要老总批 --- 职责链模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter24.md)
109+
下一章:[第二十四章 加薪非要老总批 --- 职责链模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter24.md)

chapter24.md renamed to files/chapter24.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ foreach ($requests as $value) {
6565
6666
> 一个请求极有可能到了链的末端都得不到处理,或者因为没有正确配置而得不到处理。
6767
68-
上一章:[第二十三章 烤羊肉串引来的思考 --- 命令模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter23.md)
68+
上一章:[第二十三章 烤羊肉串引来的思考 --- 命令模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter23.md)
6969

70-
下一章:[第二十五章 世界需要和平 --- 中介者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter25.md)
70+
下一章:[第二十五章 世界需要和平 --- 中介者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter25.md)

chapter25.md renamed to files/chapter25.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ $c2->send('no, do you want to invite me to dinner?');
9797
9898
> 中介者模式一般应用于一组对象以定义良好但是复杂的方式进行通信的结合,以及想定制一个分布在多个类中的行为,而又不想生成太多的子类的场合。
9999
100-
上一章:[第二十四章 加薪非要老总批 --- 职责链模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter24.md)
100+
上一章:[第二十四章 加薪非要老总批 --- 职责链模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter24.md)
101101

102-
下一章:[第二十六章 项目多也别傻做 --- 享元模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter26.md)
102+
下一章:[第二十六章 项目多也别傻做 --- 享元模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter26.md)

chapter26.md renamed to files/chapter26.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ echo "网站分类总数:".$f->getWebSiteCount()."\n";
8686
8787
> 如果一个应用程序使用了大量的对象,而大量的这些对象造成了很大的存储开销时就应该考虑使用;还有就是对象的大多数状态可以外部状态,如果删除对象的外部状态,那么可以用相对较少的共享对象取代很多组对象,此时可以考虑使用享原模式。
8888
89-
上一章:[第二十五章 世界需要和平 --- 中介者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter25.md)
89+
上一章:[第二十五章 世界需要和平 --- 中介者模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter25.md)
9090

91-
下一章:[第二十七章 其实你不懂老板的心 --- 解释器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter27.md)
91+
下一章:[第二十七章 其实你不懂老板的心 --- 解释器模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter27.md)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### 第二十七章 其实你不懂老板的心 --- 解释器模式
22

3-
上一章:[第二十六章 项目多也别傻做 --- 享元模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter26.md)
3+
上一章:[第二十六章 项目多也别傻做 --- 享元模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter26.md)
44

5-
下一章:[第二十八章](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter28.md)
5+
下一章:[第二十八章](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter28.md)

chapter3.md renamed to files/chapter3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
1111
> 如果你能够想到多于一个的动机改变一个类,那么这个类就具有多于一个类的职责。
1212
13-
上一章:[第二章 商场促销 --- 策略模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter2.md)
13+
上一章:[第二章 商场促销 --- 策略模式](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter2.md)
1414

15-
下一章:[第四章 考研求职两不误 --- 开发-封闭原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter4.md)
15+
下一章:[第四章 考研求职两不误 --- 开发-封闭原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter4.md)

chapter4.md renamed to files/chapter4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
1818

1919

20-
上一章:[第三章 拍摄UFO --- 单一职责原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter3.md)
20+
上一章:[第三章 拍摄UFO --- 单一职责原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter3.md)
2121

22-
下一章:[第五章 会修电脑不会修收音机? --- 依赖倒转原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/chapter5.md)
22+
下一章:[第五章 会修电脑不会修收音机? --- 依赖倒转原则](https://github.com/flyingalex/design-patterns-by-php/blob/master/files/chapter5.md)

0 commit comments

Comments
 (0)
0