Code review is a very important means to ensure the quality of code in practice. It has been widely used in industry since it was proposed. Nowadays code review is still mainly done by manual work in industry. However, increasing scale of the software challenges manual reviewing. So automating the code review process is highly desired. Design patterns are a set of summaries of code design experiences that are widely used repeatedly, and well classified. Programmers need to correctly implement code based on design patterns. To ensure that the code is implemented as expected, this paper proposes an approach to automatically review code in the view of specified design patterns. Firstly, we identify the design patterns that are specified in the design models. Second, we construct a set of review rules by extracting design constraints from identified design patterns. Last, the code is checked against the generated review rules, and inconsistencies are reported as result. A supporting tool was developed, and two experiments were conducted to demonstrate the applicability of our approach.