The Abstract Factory pattern, also known as Kit, is a creational GoF design pattern by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides that provides an interface for creating families of related or dependent objects without specifying their concrete classes. A system configured with one factory gets products from one family only, which keeps it independent of how products are created and enforces that related products are used together.

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."