Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

uml - Use case diagram relationships and application workflow

I want to create a use case diagram (along with use case scenarios) for my application, but I'm not very familiar with that. My app has a couple of screens, every screen contains some functionality that user can interact with.
Let's assume that it's a car sharing app, and first screen contains two actions to do:

  • browse cars → which moves the user to another screen, when he can see a list of cars
  • view rental history → which moves the user to another screen, when he can see a list of cars he has rent in the past

I think that these two actions are two use cases, for examlple action "browse cars" is use case "browse cars" with workflow:

  1. App displays a list
  2. App downloads data (→ it may lose connection here etc.)
  3. App displays data

Am I right? Then, the diagram should look something like this (A is the actor)?:

A __ UC1
|___ UC2

Next, from "browse cars" screen I can, for example, see car's details, from details I can rent it and so on...
I am not sure, if these actions should be treated as <<extend>> relationship, or it should be just standalone use case from actor.
I don't think that renting a car, displaying list or car's details should really depend on each other. It depends in the app, because the screens are grouped by functionality and that is the expected workflow in my case, but in other UI design it may differ. Should I care about the expected workflow or not?

Should it be like this:
A -- UC1 ←extend--- UC3 ←extend--- UC4
|___ UC2

or this:
A __ UC1
|___ UC2
|___ UC3
|___ UC4

My app contains many many features (about 40 defined for now) and I have to present every use case on the diagram.
In first case it will look like a tree and will be similar to this:

[enter image description here]

(Taken from https://creately.com/diagram/example/i04a0uvo5/Group%20Use%20case.)

Is it a valid use case diagram?

In second case it will look like a big column of ellipses, like this, but with much more use cases:

enter image description here

Which should I choose? If I should draw it as in exapmple 2, what is the purpose of <<extend>> then? Also, "browse cars" and "show car's details" are two independent use cases, or should it be combined to one?

One more question is, if I have two actors which can do the same thing but the result is different, should it be two different use cases or one, and I should include a some kind of condition in use case scenario then?

Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Simply your first approach is a functional decomposition and just wrong. Use cases are about added value a system under consideration brings to its actors. So the 2nd picture is good. I'm not having read the details of your description.

I recommend (as always) to read Bittner/Spence about Use Case Modeling.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...