Use the Prototype pattern when…


You want to:

  • Hide concrete classes from the client.
  • Add and remove new classes (via prototypes) at runtime.
  • Keep the number of classes in the system to a minimum.
  • Adapt to changing structures of data at runtime.

Because:

  • In C# 3.0, cloning by deep copying is absolutely straightforward.

Consider using this pattern:

  • With the Composite pattern, to provide archiving.
  • Instead of the Factory Method pattern, when subclasses start proliferating.