I'm writing driver-level code that runs on a microcontroller. I've described some of the design with use cases. The users in my use cases are the the other software components that use my driver. However, I also receive input from the hardware itself in the form of interrupts. How do I describe those interrupts in my use cases? Is the hardware itself another user? Do I describe the interrupts as exception cases in my existing use cases instead? That may be difficult since some of the interrupts are asynchronous and may happen at any time during any use case.
Asked
Active
Viewed 929 times
4
-
Have a look here: https://www.scrum.org/Forums/aft/1472 – Erik Eidt Nov 18 '16 at 17:57
-
I agree that hardware is a legitimate actor, but interrupts, events and the like are *implementation details.* – Robert Harvey Nov 18 '16 at 19:21
-
I have removed the comment because I didn't want it to lead to false assumptions. After reading Christopher's answer I understood why Robert Harvey cataloged interruption as *implementation details*. It make sense. – Laiv Nov 18 '16 at 20:14
1 Answers
5
The system under consideration in your model seems to be your microcontroler with your driver.
The actors interact with this system under consideration. They are of two kinds :
- primary actors: they use the system to achieve their goal. They are often represented on the left side of the diagram. Here, it's the software components that use the driver.
- secondary actors: they are other actors involved in a use case. They are usually represented on the right side of the diagram. Here it's the hardware.
I have the impression that the interruptions are not specific to the one or the other use case, and therefore shouldn't be represented as an extension or an exception to them.
If you want to represent interruption, you'd rather go for a distinct use case. I wonder however if it's necessary at all:
- the interruptions do not represent a goal for any of your actors
- the interruptions are not created by the external hardware, but by your own system (i.e.microcontroller response to an input signal), so it seems to be rather an internal implementation detail of how some interactions are handled.
- the logic of interruption and their timing could better be represented using other behavioral diagrams (e.g. an activity diagram with an interruptible activity region).

Christophe
- 74,672
- 10
- 115
- 187
-
I have never heard of that left-primary/right-secondary rule :-/ I always used stereotyped associations (e.g. `< – Nov 18 '16 at 23:41
-
@ThomasKilian Not a rule, more a common practice. I've seen it quite often. I don't know its origin, but I have a pocket memento and other references that states it (e.g. [this book](https://books.google.fr/books?id=NqGVzs-ySYcC&pg=PA12&lpg=PA12&dq=primary+secondary+actor+uml+left&source=bl&ots=Z_kyFHTLeY&sig=ZWxY8i9eYGjsmVDvPRIZ4D7xGSw&hl=fr&sa=X&ved=0ahUKEwiQ5Ze-x7PQAhWCbhoKHUlEAvA4ChDoAQgaMAA#v=onepage&q=primary%20secondary%20actor%20uml%20left&f=false), or [this paper](http://www.scenarioplus.org.uk/papers/reqts_in_uml/reqts_in_uml.htm) or [SO](http://stackoverflow.com/a/6464534/3723423) ) – Christophe Nov 19 '16 at 00:32
-
One never stops learning :-) At least I see my practice also used in the SO answer you cite. – Nov 19 '16 at 08:30