Implementing UML associations in Java: a slim code pattern for a complex modeling concept

  • Authors:
  • Dominik Gessenharter

  • Affiliations:
  • Ulm University, Ulm, Germany

  • Venue:
  • Proceedings of the Workshop on Relationships and Associations in Object-Oriented Languages
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Relationships are difficult to implement for two main reasons: Firstly, they provide a complex semantics for relating entities and secondly, relationships are not first class constructs in modern programming languages. The challenge of implementing relationships in code is to resolve the semantics of abstract model elements and turn them into references or pointers of the target language. Language extensions or libraries are often discussed as a means of facilitating the translation of relations into code. We present an approach that uses plain Java language concepts for the implementation of UML associations. We focus on symmetry of associations as well as on navigability, visibility and ownership of association ends and present a code pattern, that can easily be used for automatic code generation.