Design patternsPrototype Pattern


Introduction

The Prototype pattern is a creational pattern that creates new objects by cloning existing prototype object. The prototype pattern speeds up the instantiation of classes when copying objects is faster.

Remarks

The prototype pattern is a creational design pattern. It is used when the type of objects to create is determined by a prototypical instance, which is "cloned" to produce new objects.

This pattern is used when a class need a "polymorphic (copy) constructor".