patterns overview state pattern decorator pattern state and decorator patterns downloads references home
about three-ten software created with contact
State and Decorator Patterns: Source Code  

Displayed below are two UML diagrams describing the state pattern and decorator pattern when used together.

The first UML depicts the general properties of the state pattern when used with the decorator pattern, while the second UML diagram has been customized to match our provided code sample.

Please note: The diagrams seen below have been purposely shrunk to their current size, as the original diagrams are quite large. To see the UML diagram in its entirety, click on its corresponding scaled-down version.


General UML diagram of the state pattern when used with the decorator pattern.


UML diagram of the state pattern used with the decorator pattern when applied to Gambler code.