问题
I'm trying to model a use case, basically it's how a round is played in a quiz-show. the actor in the use case is the quizmaster; he asks the questions to the participants.
There's a lot going on in this use case but my problem comes down to the point where the quizmaster has to wait for a player to buzz his button and give an answer to a question he has asked so it can be judged (Right or wrong).
There's a seperate use case the actor "Candidate" follows to answer the question the quizmaster has asked.
How do I model the fact that the quizmaster has to wait for another actor to do a use case before he can continue with his own use case? Or is it better to just seperate them all into smaller-sized use cases. My teacher advised against that though so I was looking for a second opinion here.
回答1:
You can either do an include as user3934037 suggested, or you could make it separate usecases and work with the pre/postconditions In that case you would have usecases
Ask Question
-> precondition: Candidates ready
-> postcondition: Question asked
Respond Question
-> precondition: Question asked
-> postcondition: Question responded
Judge Response
-> precondition: Question responed
-> postcondition: Response Judged
Instead of linking use cases in a sequence together you leave them independent of each other. Use Case "Judge Response" isn't waiting for a specific use case to finish, it is waiting until it preconditions are met, however that came to be.
In general I advise to keep order of execution out of use case analysis (and leave it in business process modelling)
回答2:
UseCase declare usefull functionality of modeled system. There is not any way to define execution aspects as you described in your example. If you need to define some of event processing or actions, use some of behavioral element (Activity, StateMachine or Interaction).
回答3:
I agree with Geert on this, except I would more strongly advise his approach. Use cases aren't designed to explain any sort of flow, period. You can use preconditions and postconditions to infer an order of execution, but if you want to be crystal clear on the order of execution of a use case, take Vladimir's advice and map it out with an activity diagram.
回答4:
I want to say this first.. there is no correct answer in UML. If you can explain your thought correctly with your uml diagram, that is the answer. I think this can be solved with <<include>> relation. CaseA ---<<include>>-->CaseB means CaseA can be performed when CaseB is satisfied.
for example,
"withdraw money from the account" ----<<include>>----> "authenticate the user"
I guess it can also be used to describe the sequence of each use case. :)
回答5:
UML explicitly does not cover this need by a recommendation (AFAIK). It seems to indicate that there's something odd in your current Use Case analysis. Maybe structuring your Use Case Diagrams using design scopes and goal levels into several levels of detail would eliminate the sequencing
This is how Alistair Cockburn suggests to balance the Use Case density in article "Use case goals versus design scopes"
See also:
- uml-diagrams.org: How to Draw UML Use Case Diagram
来源:https://stackoverflow.com/questions/28031171/uml-use-case-waiting-for-another-use-case-to-finish