diff --git a/notes/pics/dp-prototype.png b/notes/pics/dp-prototype.png new file mode 100644 index 00000000..9ec36b9a Binary files /dev/null and b/notes/pics/dp-prototype.png differ diff --git a/notes/设计模式 - 原型模式.md b/notes/设计模式 - 原型模式.md index 50dc005a..543470ce 100644 --- a/notes/设计模式 - 原型模式.md +++ b/notes/设计模式 - 原型模式.md @@ -1,15 +1,12 @@ ## 6. 原型模式(Prototype) -### Intent - +### 意图 使用原型实例指定要创建对象的类型,通过复制这个原型来创建新对象。 -### Class Diagram - -

- -### Implementation +### 类图 +

+### 实现 ```java public abstract class Prototype { abstract Prototype myClone(); @@ -47,10 +44,14 @@ public class Client { } ``` -```html +```text abc ``` -### JDK - +### JDK 中的应用 - [java.lang.Object#clone()](http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone%28%29) + +## 参考资料 + +- 弗里曼. Head First 设计模式 [M]. 中国电力出版社, 2007. +- Gamma E. 设计模式: 可复用面向对象软件的基础 [M]. 机械工业出版社, 2007.