Skip to content

Commit 4399523

Browse files
committed
添加日常中运用工厂方法的例子
1 parent 2381ad7 commit 4399523

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/com/company/factory/summary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
工厂方法模式是创建型设计模式之一,是一种简单的模式,也是使用很广泛的一种设计模式。
44
Android中的Activity的onCreate等方法都可以看成是工厂模式的例子。setContentView()
55
中可以设置各种view返回给framework进行处理
6+
又如:在数据结构中:ArrayList和HashMap中都运用了工厂模式
7+
以List和Set为例,List和Set都继承于Collection接口,Collection接口继承于Iterale接口。在两个具体类实现
8+
这个类的过程中就用了工厂方法。
69

710
定义:
811

0 commit comments

Comments
 (0)