![Building Microservices with Spring](https://wfqqreader-1252317822.image.myqcloud.com/cover/86/36699086/b_36699086.jpg)
上QQ阅读APP看书,第一时间看更新
UML class structure
The following UML diagram shows all the components of the Prototype design pattern:
![](https://epubservercos.yuewen.com/ACD8B1/19470384008836706/epubprivate/OEBPS/Images/cadd483b-553b-47db-99db-23cb483d6766.png?sign=1738881857-p1MpoJo8oGoboswFAwqJe1Ie6gBE6LBp-0-2ab6d7fef9e66dd970f6366ee7658ba6)
UML diagram for Prototype design pattern
Let's see these components as listed in following points:
- Prototype: The Prototype is an interface. It is uses the clone method to create instances of this interface type.
- ConcretePrototype: This is a concrete class of the Prototype interface to implement an operation to clone itself.
- Client: This is a caller class to create a new object of a Prototype interface by calling a clone method of the prototype interface.
Let's see a sample implementation of the prototype design pattern.