Design pattern explained PDF version with C++ implementation source code