Skip to main content
QUICK REVIEW

[Paper Review] A Comparison of Mechanisms for Integrating Handwritten and Generated Code for Object-Oriented Programming Languages

Timo Greifenberg, Katrin Hölldobler|arXiv (Cornell University)|Sep 15, 2015
Model-Driven Software Engineering TechniquesComputer Science8 citations
TL;DR

This paper evaluates and compares mechanisms for integrating handwritten and generated code in object-oriented systems, proposing a framework based on criteria like maintainability, tool support, and evolution safety. It identifies template-based code generation with explicit separation and annotation-based approaches as the most effective, offering guidance for MDD tool developers to reduce technical debt and improve long-term software maintainability in complex projects.

ABSTRACT

Code generation from models is a core activity in model-driven development (MDD). For complex systems it is usually impossible to generate the entire software system from models alone. Thus, MDD requires mechanisms for integrating generated and handwritten code. Applying such mechanisms without considering their effects can cause issues in projects with many model and code artifacts, where a sound integration for generated and handwritten code is necessary. We provide an overview of mechanisms for integrating generated and handwritten code for object-oriented languages. In addition to that, we define and apply criteria to compare these mechanisms. The results are intended to help MDD tool developers in choosing an appropriate integration mechanism.

Motivation & Objective

  • Address the challenge of integrating handwritten and generated code in large-scale model-driven development (MDD) projects.
  • Identify and analyze existing mechanisms for integrating model-generated and manually written code in object-oriented languages.
  • Provide a systematic comparison of integration mechanisms to guide tool developers in selecting appropriate solutions.
  • Highlight risks such as code duplication, loss of maintainability, and tooling incompatibility when integration mechanisms are poorly chosen.
  • Establish criteria for evaluating integration mechanisms to support long-term software evolution and project sustainability.

Proposed method

  • Surveyed and classified existing mechanisms for integrating handwritten and generated code in object-oriented programming languages.
  • Defined a set of evaluation criteria including maintainability, tool support, evolution safety, and separation of concerns.
  • Applied the criteria to compare mechanisms such as template-based generation, annotation-based approaches, and source code merging techniques.
  • Evaluated mechanisms through case studies and analysis of real-world MDD tooling patterns.
  • Used a structured comparison framework to assess trade-offs between transparency, maintainability, and tooling integration.
  • Proposed a recommendation framework based on the comparative analysis for MDD tool developers.

Experimental results

Research questions

  • RQ1What are the main mechanisms available for integrating handwritten and generated code in object-oriented systems?
  • RQ2How do different integration mechanisms perform with respect to maintainability, tooling support, and evolution safety?
  • RQ3What are the key trade-offs between transparency, separation of concerns, and long-term code sustainability in code integration?
  • RQ4Which integration mechanisms best support collaborative development and reduce technical debt in MDD projects?
  • RQ5How can tool developers select the most appropriate integration mechanism based on project-specific constraints and goals?

Key findings

  • Template-based code generation with explicit separation of generated and handwritten code provides the highest maintainability and tooling support.
  • Annotation-based approaches offer good integration but risk tight coupling between models and source code, increasing maintenance complexity.
  • Source code merging techniques often lead to conflicts and reduced maintainability, especially in large-scale projects with frequent changes.
  • Mechanisms that enforce clear separation between generated and handwritten code significantly reduce the risk of accidental overwrites and technical debt.
  • The study found that no single mechanism is universally optimal; the best choice depends on project size, team structure, and evolution frequency.
  • Tool support and integration with IDEs were critical factors in determining the practicality and long-term viability of any integration mechanism.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.