Differentiate between Reflexive Association and Directed Association by considering Student as an example. Depict using simple diagram.
The reflexive association is a subtype of association relationship in UML. In this type of association, the instances of the same class can be related to each other. An instance of a class is also said to be an object. It states that a link or a connection can be present within the objects of the same class.
Let us consider an example of a class Student. The Student class has two instances, such as John and Sam. Reflexive association states that a link between John and Sam can be present as they are instances of the same class. Such as they can have a relationship named 'friend', which means John is a friend of Sam and vice-versa.
So, it basically means that relationships can exist between two different objects of the same class.
The directed association is related to the direction of flow within association classes.
In a directed association, the flow is directed. The association from one class to another class flows in a single direction only.
It is denoted using a solid line with an arrowhead. ( -> )
Example:
You can say that there is a directed association relationship between a teacher and a student. A teacher can answer a lot of questions/queries of a student. This flow is unidirectional, that flows from teacher to student only, which means only a teacher can solve the doubts of a student and not vice-versa.
Get Answers For Free
Most questions answered within 1 hours.