Skip to content

Commit 69e9fb1

Browse files
committed
Added real world example of Prototype.
1 parent 6bab9ed commit 69e9fb1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
* to avoid building a class hierarchy of factories that parallels the class hierarchy of products; or
8888
* when instances of a class can have one of only a few different combinations of state. It may be more convenient to install a corresponding number of prototypes and clone them rather than instantiating the class manually, each time with the appropriate state
8989

90+
**Real world examples:**
91+
* [java.lang.Object#clone()](http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#clone%28%29)
92+
9093
## <a name="singleton">Singleton</a> [&#8593;](#list-of-design-patterns)
9194
**Intent:** Ensure a class only has one instance, and provide a global point of access to it.
9295

0 commit comments

Comments
 (0)