Skip to content

Commit 175a99d

Browse files
committedOct 12, 2019
no message
1 parent 9bcf7b5 commit 175a99d

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed
 

‎J2eeServiceLocatorPatternDemo.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface Service {
1313
public void execute();
1414
}
1515

16-
class Service1 implements Service {
16+
class Service1 implements Service {
1717
public void execute(){
1818
System.out.println("Executing Service1");
1919
}
@@ -23,7 +23,7 @@ public String getName() {
2323
return "Service1";
2424
}
2525
}
26-
class Service2 implements Service {
26+
class Service2 implements Service {
2727
public void execute(){
2828
System.out.println("Executing Service2");
2929
}
@@ -34,7 +34,7 @@ public String getName() {
3434
}
3535
}
3636

37-
class InitialContext {
37+
class InitialContext {
3838
public Object lookup(String jndiName){
3939
if(jndiName.equalsIgnoreCase("SERVICE1")){
4040
System.out.println("Looking up and creating a new Service1 object");
@@ -48,7 +48,7 @@ public Object lookup(String jndiName){
4848
}
4949

5050

51-
class Cache {
51+
class Cache {
5252

5353
private List<Service> services;
5454

@@ -79,7 +79,7 @@ public void addService(Service newService){
7979
}
8080
}
8181

82-
class ServiceLocator {
82+
class ServiceLocator {
8383
private static Cache cache;
8484

8585
static {

‎README.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
# python36patterns
22
最全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

0 commit comments

Comments
 (0)
Please sign in to comment.