Design Pattern - 3. Decorator pattern

Post on 16-Apr-2017

606 views 11 download

Transcript of Design Pattern - 3. Decorator pattern

PRESENTATION NAME

Decorator Pattern

Francesco Ierna

Decorator Pattern

1. Creo base

2. wrappo la base aggiungendo condimenti

3. il totale dato dal costo della base + i condimenti che sono stati aggiunti alla base

Oggetti:

Base + n condimenti aggiunti alla base

Decorator Pattern Problem

Solution

Solution Example

Decorator Code Example

Code Example

Code