mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-03 07:13:02 +00:00
docs: property, prototype, proxy diagrams
This commit is contained in:
1 parent
3abaa83710
commit
23af67c755
6 files changed
+12
No files matched your search
@@ -35,6 +35,10 @@ Wikipedia says
|
||||
|
||||
> The prototype pattern is a creational design pattern in software development. It is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Prototype Pattern in Java
|
||||
|
||||
In Java, the prototype pattern is recommended to be implemented as follows. First, create an interface with a method for cloning objects. In this example, `Prototype` interface accomplishes this with its `copy` method.
|
||||
|
||||
Reference in new issue
Block a user