Skip to content

Decorator: Composition or Aggregation? #518

@thomasoss

Description

@thomasoss

Hello, I refere to decorator pattern
I think the relationship between decorator and target (in the code example between Troll und SmartTroll) ist not a composition as described in the code comment lines of class App. In a compostion both instances canncot live without the other one. But the target (Troll) could live without the decorator (Smart Troll). Consequently this is a aggregation?
Greetings
Thomas

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions