Allow an object to alter its behavior when its internal state changes.
Motivation
An article in a typical editorial workflow exibits different behaviours in different publication stages. We want an object that hides the complex logic.
Implementation
Similar to the strategy pattern. Need to handle state change and behaviour change.
Examples
$new_state="edit";
$new_protocol="edit";
//change the behaviour
list($view,$update,$get, $set) = $object->protocol($new_protocol);