DesignPattern with C++