Learning design patterns