File tree 2 files changed +28
-5
lines changed
2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public interface Service {
13
13
public void execute ();
14
14
}
15
15
16
- class Service1 implements Service {
16
+ class Service1 implements Service {
17
17
public void execute (){
18
18
System .out .println ("Executing Service1" );
19
19
}
@@ -23,7 +23,7 @@ public String getName() {
23
23
return "Service1" ;
24
24
}
25
25
}
26
- class Service2 implements Service {
26
+ class Service2 implements Service {
27
27
public void execute (){
28
28
System .out .println ("Executing Service2" );
29
29
}
@@ -34,7 +34,7 @@ public String getName() {
34
34
}
35
35
}
36
36
37
- class InitialContext {
37
+ class InitialContext {
38
38
public Object lookup (String jndiName ){
39
39
if (jndiName .equalsIgnoreCase ("SERVICE1" )){
40
40
System .out .println ("Looking up and creating a new Service1 object" );
@@ -48,7 +48,7 @@ public Object lookup(String jndiName){
48
48
}
49
49
50
50
51
- class Cache {
51
+ class Cache {
52
52
53
53
private List <Service > services ;
54
54
@@ -79,7 +79,7 @@ public void addService(Service newService){
79
79
}
80
80
}
81
81
82
- class ServiceLocator {
82
+ class ServiceLocator {
83
83
private static Cache cache ;
84
84
85
85
static {
Original file line number Diff line number Diff line change 1
1
# python36patterns
2
2
最全python36种设计模式。opp和oop的极致使用方式,一切编码思维逃不出这36计。
3
+ 使用设计模式或oop转化公式,能使几乎任意项目代码减少50%至90%行,编码速度快一倍。
4
+ 扩展性和维护性提高数十倍,bug减少5倍。
5
+ 如果是使用极端纯面向过程(或者加入了少量无效废物类)的方式来写python代码,
6
+ 我不用看,一定很low。
7
+
8
+
9
+
10
+
11
+ 学弟啊,你代码能不能不要写得这么烂
12
+ https://www.toutiao.com/a6739759206997426696/
13
+
14
+ 面向对象和面向过程分别是什么?
15
+ https://www.zhihu.com/question/28790424
16
+
17
+ 如何通俗易懂地举例说明「面向对象」和「面向过程」有什么区别?
18
+ https://www.zhihu.com/question/27468564
19
+
20
+
21
+ 对于程序员来说,设计模式和算法哪个更重要呢?
22
+ https://www.zhihu.com/question/25432487
23
+
24
+ 为什么我们需要学习(设计)模式
25
+ https://zhuanlan.zhihu.com/p/19835717
You can’t perform that action at this time.
0 commit comments