How to make use case diagram using Generalization in UML
Purpose of this tutorial is to give you understanding of how to use generalization, include and extend relationships when making use case diagrams.
Before we start I assume that readers have some idea about how inheritance concept works in object oriented programming. Generalization in UML is basically the same concept of making subclasses whenever possible, if you see there are actors in the system that perform many similar tasks then you can associate them with generalization relationship, I will further clarify it with an example. "Include relationship" is such that if a certain use case must function at the end of another use case then there will be an "include relationship" between these two use cases. If a use case extends the functionality of another use case then they will have "extend relationship" between them. For our demonstration purposes we will use the following diagram.
Draw a use case diagram of a system showing a Consultant who can record consultancy visits and consultancy expenses. A Senior Consultant can do all that a Consultant can do, but can also initiate consultancy project and conclude consultancy project and Invoice customer.
In the diagram above we used generalization relationship between two actors as Senior Consultant can do everything a consultant can do so basically senior consultant is a consultant with some extra responsibilities so in all such cases we can use generalization between actors. We can use extend relation between "Recording Consultancy Visit" and "Recording Consultancy Expense" because "Recording Consultancy Expense" use case is a conditional use case which is only called if consultancy visit is a paid visit. We used an include relation between "Conclude Consultancy Project" and "Invoice Customer" as "Invoice Customer" use case must be called when a project concludes, in any such condition when we have a use case that must be called after a use case then there will be an include relationship.
I hope this tutorial will help you understand generalization, include and extend relationships in use case diagrams.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.