DesignPattern sample code