= Solution
The <decorator pattern> participants are:
* \b[Component:] `CableTV` declares the common `cost` and `packages` queries, so clients can use both basic and decorated accounts through one <object interface>.
* \b[Concrete component:] `BasicPlan` supplies the initial price and package description.
* \b[Decorator:] the abstract `Packages` class stores a component reference and forwards its operations, enabling recursive <object composition>.
* \b[Concrete decorators:] `Movies` and `HDChannels` override the queries to add one responsibility while preserving the wrapped component's behavior.
* \b[Client:] an application chooses the nesting of components and observes the resulting account through `CableTV`.
Each wrapper contributes its price exactly once along the chain. The same structural arrangement handles a new optional package without changing the existing component interface.
Back to article page