Sample Code for Design Patterns