1. A method for generating code from a class model for a modeled system, said class model specifying a plurality of elements of a modeling language, dependencies between and constraints on elements of said plurality of elements, the method comprising: an analysis step for analyzing said class model to identify a first possible source of under-specification with respect to the modeled system in said class model by using pattern recognition to find an occurrence of a first problem pattern of a plurality of problem patterns in said class model, said plurality of problem patterns being stored in a repository; a selection step for selecting a set of constraint patterns comprising at least a first constraint pattern, said at least first constraint pattern being linked in said repository to said first problem pattern, said at least first constraint pattern being a resolution to said first possible source of under-specification in the class model; a presentation step for presenting said set of constraint patterns to a user; a reception step for receiving a user selection from said user, said user selection comprising a selected constraint pattern from said set of constraint patterns; an instantiation step for instantiating constraints from said selected constraint pattern; and a code generation step for generating code based on said class model and the instantiated constraints.