1

I am creating a Use-Case diagram in StarUML for a university project but I am not completely sure if I'm doing it correctly.

For example, on the website I am making I have 2 roles - User and Admin. The admin can do everything that the user can plus some extra.

In my Use-Case diagram, should the admin actor have the same use-cases as the user plus the extra ones only he can use or should he only have use-cases that are available to the admin.

Example 1:

User--->Upload File

Admin--->Upload File
     --->Delete File

Example 2:

User--->Upload File

Admin--->Delete File

In the examples, User and Admin are the roles, ---> is the directed association and Upload/Delete file are the 2 Use-Cases. Which example would be the correct one?

Onyx
  • 5,186
  • 8
  • 39
  • 86

1 Answers1

4

As always there is single and clear answer ... it depends.

If you are realy doing use case analysis, then you want to identify what uses cases an actor needs and what actors are interacting with a use case. Thus, if an admin (when acting as an admin) shall also being allowed to upload files, then he needs an association to the correspondig use case. Becuase he might have some further needs for the use case as the user. A second possibility is to model that an admin is also an user. This is modelled by generalization. This has some further effects and you need to be verycarefully when soing this (in larger context). And further, it is for non-deverlopers a bit cumbersome to see that a special actor is also a normal actor. E.g., consider this when saying the manager has more use cases than an employee (this will lead to long and pointless discussions with your manager...).

So your example 2 is not realy incorrect but misses the point of an use case analysis.

sim
  • 1,148
  • 2
  • 9
  • 18
  • 2
    I'd prefer synthesis rather than analysis since the latter lets people think of functional analysis which is not what UCs are all about. Else I concur with your answer. – qwerty_so Sep 11 '18 at 06:00
  • 1
    Thank you, this is what I needed to know! – Onyx Sep 11 '18 at 08:40
  • 1
    I like Thomas' distinction re: synthesis vs. Analysis. Although analysis was used to find the actors and use cases, the use case diagram is definitly a good example of synthesis. Thanks Thomas! – CharlesRivet Sep 12 '18 at 13:24