Relationships in USE CASE Diagrams:
“ONE PICTURE IS WORTH A THOUSAND WORDS.” Quoted by Fred R Barnard, an advertising executive.
Similarly, a Use Case diagram is a diagrammatic representation of a complex system-user interactions. In other words, a Use Case diagrams represents how a user/third-party actor interacts with the system and how the system reacts/responses to the interaction.
With the help of this diagram, a layman can easily understand the structure of the system without having proper knowledge about it. Hence it is used to communicate the stakeholders.
The way of interactions is called the Relationships. It can be happened between two use cases or between an actor and a use case or between two actors.
There are some specific relationships as below.
- Association can be used as interaction between an actor and a use case.
- It is represented as a straight line. ( )
- This means an actor/user is interacting system using usecase.
- Example: A customer is using ATM using inserting his ATM card.
- Actor – The Customer
- System/usecase – ATM machine
- Association – Inserting card
- Generalization is a relationship which is basically represented between two generic behavioural Use Cases and the child class is a Kind Off Parent class. Generalization of use case can be used when Parent class doesn’t exist without child class.
- It is represented as an arrow pointing towards parent class. ( ).
- Generalization is of two types.
- Use Case generalization:
- Generalization of use case can be used when Parent class doesn’t exist without child class.
- g., A customer has 3 payment options i.e., by cash/card/cheque. Here payment is parent class and cash/card/cheque are child class.
- Actor generalization:
- Generalization of an Actor is inculcating the inheritance property among the Actors, In which the child actor indirectly holds the interactions the parent Actor does.
- g., A privileged customer is a general customer with extra benefits. Here customer is parent class and privileged customer is child class.
- Extend is a relationship two use cases when Parent class exists even without Child class.
- This is used where relationship is optional.
- It is represented as arrow towards parent with <extends>( ).
- g., Checking a/c balance post withdraw of cash from ATM.
- Extend is a relationship two use cases when Parent class exists with Child class.
- This is used when the relationship is mandatory/compulsory.
- It is represented as arrow towards child with <include>/ <uses>
- g., Bank central server sent alert message to check cash level in ATM after each transaction.