design patterns by example