The prototype design pattern is one of the twenty-three well-known Gang of Four (GoF) design patterns. Recall that, design patterns are proven solutions to solve recurring design problems to design flexible and reusable object-oriented software; that is, objects that are easier to implement, change, test and reuse.
The prototype design pattern is often used to create objects by cloning an existing object called a prototype.
We may use the Prototype Pattern when it is considered expensive or complicated to create an instance of a given class by copying or cloning an existing instance.
Slides
Video
…
Code
Vehicle.java
|
|
Car.java
|
|
Minivan.java
|
|
Motorcycle.java
|
|
|
|
|
|
|
|
|
|