Application of design patterns implemented in Java