Examples of various design patterns [java & c++]