Code samples and class diagram for design patterns learning