The 'Gang of Four' Companion:

State Design Pattern

Formal specification of design patterns in LePUS3 and Class-Z

Print this document

This page is part of the The 'Gang of Four' Companion dedicated to the formal specification in LePUS3 and Class-Z of patterns from the 'Gang of Four' catalogue [Gamma et al 1995].



The State design motif

The informal description: Excerpts from [Gamma et al. 1995] (adapted for this purpose):

Intent: Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

Structure: Original OMT diagram converted to UML (Why and How?):

State in UML



Formal specification

See also:

State in LePUS3
State pattern in LePUS3 (legend)
State pattern in Class-Z (legend)