GoF-Composite Pattern

Details
Full Name

GoF Composite Pattern (Structural)

Intent:

Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly.

When to Use:

  • When you want to represent part-whole hierarchies of objects

  • When you want clients to be able to ignore the difference between compositions of objects and individual objects

Prompt Example:

"Modelliere das Dateisystem nach dem GoF-Composite Pattern, sodass Dateien und Ordner einheitlich behandelt werden können."