Patent ID: 8656349

Claim:
A computer-implemented method modifying templates in a code generation process comprising: receiving a template for generating code; receiving a model for generating code, wherein the model specifies the operation of the software and comprises a plurality of elements to be translated into code constructs, and wherein the template specifies code constructs to be used for the plurality of elements in the model; processing the template and the model in a code generator, and in accordance therewith, generating code based on the model and the template; receiving a modification to the generated code, and in accordance therewith, producing modified code; automatically changing the template based on the modified code and not on a rewrite of the template by a user to produce a modified template; and processing the modified template and the model in the code generator, and in accordance therewith, generating second code based on the model and the modified template, wherein the second code automatically includes the modification; mapping one or more elements in said template to corresponding elements in said generated code, wherein the element in said template caused the element in said generated code to be generated, wherein the template comprises a plurality of definitions of source code constructs to be generated based on specified elements of the model, the method further comprising monitoring the processing of the template in said code generator and storing a new mapping element each time a definition is processed, wherein different mapping elements specify a relationship between a definition and a corresponding element in said generated code; and wherein the modified code is designated as either manual or generated, wherein modified code designated as generated is used to automatically change the template to automatically produce said modified code, wherein modified code designated as manual is not automatically generated by the template, wherein the modified code is designated manual or generated through a graphical user interface, and wherein modified code designated as generated is displayed differently than modified code designated as manual in said graphical user interface.