Implementation of the "State" design pattern at example of a typical camera workflow.
Camera state machine sample.