PatternCoder is a software tool to aid student understanding of class associations. It has a wizard-based interface which allows students to select an appropriate binary class association or design pattern for a given problem. Java code is then generated which allows students to explore the way in which the class associations are implemented in a programming language. This article describes the rationale behind the tool, gives a description of the tool itself, and reports on our experiences of using the tool in our teaching.