Search code examples
exceptionumluse-case-diagram

How do I show exception in use case diagram?


I am working on a Use-case diagram (UML) and I am required to show an exception in it visually. The scenario is of a library. And the exception I want to show is system shutdown. How can I show it? Can I just use extend relationship to show the exception? I have linked my use case diagram here

Use Case with exception.

Any help would be appreciated


Solution

  • If the system shuts down unexpectedly, every communication the system has with its actors is aborted, i.e. all use cases stop immediately. This cannot be shown in a use case diagram, except by adding a UML note symbol containing the text "If the system shuts down unexpectedly, all use cases stop immediately.", but even this is pointless, because it is obvious for every system: if it stops, it stops.

    You may use extending use cases for specific exceptions known to potentially occur at specific steps in specific use cases, but not for an exception that may occur at any time during any use case.

    You may regard a late return and book damage when returning a book as exceptions. I would rename your use cases "Book damage penalty" and "Late fee penalty" in the verb-noun format (e.g. Pay late fee penalty). The arrow should point from the extending use case to the extended use case.