Sample code about Design Pattern