GoF-Abstract Factory Pattern

Details
Full Name

GoF Abstract Factory Pattern (Creational)

Also known as

Kit

Intent:

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

When to Use:

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

  • When a system should be configured with one of multiple families of products

  • When related product objects are designed to be used together and you need to enforce this constraint

Prompt Example:

"Erstelle eine Abstract Factory nach GoF, die UI-Komponenten für verschiedene Plattformen (Web, Mobile, Desktop) erzeugt, ohne dass der Client die konkreten Klassen kennen muss."