implement some design-pattern using C++ language