Ado
Ado

Reputation: 47

'Directed Association' is uno-directional Aggregation & uno-directional Composition. Change my mind

I am learning about UML-Class-Diagram and I have come across directional association. After long hours of research, I became insane because everyone is explaining it differently and there is only an abstract explanation and no explicit implementation in code.

When I discuss this topic with Microsoft Copilot or ChatGPT or DeepSeek, they all give different explanations and different code examples. They give me code examples of Aggregation or Composition and say, 'This is directional association,' so I thought maybe directional association is in fact the general term for both uno-directional aggregation and uno-directional composition.

So, my definition for directed association is: '

Directed Association is a uno-directional relation between two classes, and this relation can be aggregation or composition.

'

So now I wanted to know your opinion about this and see if you agree with me.

Upvotes: 2

Views: 37

Answers (2)

Christophe
Christophe

Reputation: 73530

In UML an association is a "structural" relation between classes, whereas association navigability is about run-time performance promises:

UML 2.5.1 section 11.5.3.1: Navigability means that instances participating in links at runtime (instances of an Association) can be accessed efficiently from instances at the other ends of the Association. The precise mechanism by which such efficient access is achieved is implementation specific. If an end is not navigable, access from the other ends may or may not be possible, and if it is, it might not be efficient.

This sheds also a light on the weakness of the colloquial term "Directed association". Because navigability is not about the association as a whole but about each end. Many diagrams show a navigability in one direction but leave navigation in the opposite direction unspecified (i.e. it could be unidirectional navigability or bidirectional navigability).

Upvotes: 1

nik0x1
nik0x1

Reputation: 1461

The first thing that makes sense to note is that both aggregation and composition are associations, but not vice versa.

The second thing to note is that any association (including aggregation and composition) can be navigable.

Directed association relationships are associations that are navigable in only one direction.

Upvotes: 0

Related Questions