GoF-Prototype Pattern

Details
Full Name

GoF Prototype Pattern (Creational)

Intent:

Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.

When to Use:

  • When a system should be independent of how its products are created and represented

  • When classes to instantiate are specified at runtime

  • When you want to avoid building a class hierarchy of factories that parallels the class hierarchy of products

Prompt Example:

"Verwende das GoF-Prototype Pattern, um neue Konfigurationsobjekte durch Klonen eines Prototypen zu erzeugen, statt sie jedes Mal von Grund auf zu konstruieren."