Sample code to demonstrate some design patterns