问题
Let's say I have the following actor:
- User
Let's say I have the following Use Cases:
- Register
- Log On
- Complete Demographics Survey
- Choose Modules
I'm confused as to how to properly model the Log On use case. Currently I have a diagram that has a relationship between the User and Log On.
Should the Log On use case be included (includes relationship) with each use case (with the exception of Register) since the user needs to be logged in to complete those functions?
回答1:
If the user is required to login as part of another use case (e.g. Complete Demographics Survey begins with prompting the user for login if they were not already logged), then yes (because the common behavior of Log On is executed as if it were a subroutine call).
On the other hand, if the user is only required to be logged in (e.g. if they are not logged the operation is rejected), then it is more a precondition than a include relationship.
来源:https://stackoverflow.com/questions/15137547/use-case-diagram-log-on-use-case