Mapping UML Associations into Java Code.
Gonzalo Génova, Carlos Ruiz del Castillo, Juan Lloréns · The Journal of Object Technology · 2003
Object-oriented programming languages do not contain syntax or semantics to express associations directly.Therefore, UML associations have to be implemented by an adequate combination of classes, attributes and methods.This paper presents some principles for the implementation of UML binary associations in Java, paying special attention to multiplicity, navigability and visibility.Our analysis has encountered some paradoxes in the specification of visibility for bidirectional associations.These principles have been used to write a series of code patterns that we use in combination with a tool that generates code for associations, which are read from a model stored in XMI format.1 Actually classifiers.Classifier is a superclass of Class in the UML metamodel.2 The current submission of communityUML to the OMG for the development of UML 2.0 [cUML] proposes a change in terminology: "association" instead of "link" and "association type" instead of "association".We support this change, but in this paper we are going to follow the current official terminology in UML.