I can't find an exact answer to this question when drawing a class diagram.
I have a class, that contains properties, and a method for external access to the data associated with that property.
It will exist within two other classes in the diagram as the datatype to the other property, the other class will hold an array of this class' instances.
I was unsure how to represent this in the diagram, my first thought was a compositional relationship but that doesn't seem quite right.
In UML a property can be an attribute of the class or the owned end of an association of that class. Semantically there’s almost no difference.
Therefore, the way one object instance is “included” in another is open to interpretations in UML diagrams, as different language have different constructs and semantics for implementing object composition. The common techniques are:
«datatype»
can be used. It means that it has a value semantic like the build-in types. You can use either an association or an attribute with the datatype as type.Whatever you chose, keep in mind that you’d better focus in the UML diagram on the semantic relationships between these classes rather than the precise implementation of these relations (which the “inclusion” in a programming language class is)