0

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

Geert Bellekens
  • 12,788
  • 2
  • 23
  • 50
Trove101
  • 13
  • 1
  • 4
  • Your «extend» relations go the wrong way. They should go from the extending use case to the base use case. – Geert Bellekens Oct 14 '19 at 06:57
  • @GeertBellekens Thanks for pointing that out. But, what i wanted to know was that whether showing exceptions as extend relationship in a use case diagram is correct? – Trove101 Oct 14 '19 at 07:45
  • There's a whole bunch wrong with your use cases, too long for a comment, and I don't have the time to write an answer. Short answer: No I wouldn't do it like that. – Geert Bellekens Oct 14 '19 at 07:57
  • @GeertBellekens, the question is how to show a system shutdown in a use case diagram, not to comment on everything else in the diagram. – www.admiraalit.nl Oct 14 '19 at 12:45
  • 1
    @www.admiraalit.nl I'm not so sure about that. It feels like the question is more on how to show exceptional behavior in a use case diagram, and the OP choose "system shutdown" as example of such an exceptional behavior. I believe exercise is meant to illustrate the «extends» relation. – Geert Bellekens Oct 14 '19 at 13:02
  • @GeertBellekens, yes, I have re-read the question and indeed, the teacher wants 'an exception' and Trove101 probably chose an inconvenient one. – www.admiraalit.nl Oct 14 '19 at 18:30
  • Hello Trove101, Please mark one of the answers as accepted, or explain what is still not clear to you. – www.admiraalit.nl Oct 17 '19 at 09:08
  • @www.admiraalit.nl Thanks for understanding the question. I know I had errors in use case as I just copy pasted one from internet. All I wanted to know was how to show an exception in a use case diagram. And it has been solved by the answers given by you and the book recommended by qwerty_so. Thank you again. Cheers! – Trove101 Oct 18 '19 at 14:49

2 Answers2

2

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.

www.admiraalit.nl
  • 5,768
  • 1
  • 17
  • 32
0

Use cases are about added value, not functionality. Your focus is the actor and showing which added value he gains from using the system under consideration.

There's a good reason for not focusing on details: you loose your view. When you start dealing with any bit you will achieve nothing but a fuss. So you create the "big picture" in your use cases. You synthesize them by reading requirements and finding out what the main points are. These are the use cases. You still have all requirements (where e.g. the shutdown behavior is detailed in various, mostly unrelated pieces).

Especially, when synthesizing use cases tech people tend to do the opposite, namely functional decomposition. That's not the starting point. This is one step further. Only when you have identified the added values you can go ahead and decompose them in activities describing scenarios inside each bubble.


As always I recommend to read Bittner/Spence about use cases.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86