Design Pattern in C++