In a use case diagram for a web based hire system that I have, the following two functionality were required.
1. To validate a user's login before carrying out a payment function.
2. To check the availability of a certain tool and a time before the user is allowed to hire it.
So, for Case 1, I believe the following is correct. Is this the proper use of an include condition, or is there some other use as well?
An actor has an association with a MAKE PAYMENT use case. An include statement is drawn from the MAKE PAYMENT use case to a VALIDATE USER LOGIN use case.
For Case 2, I mapped it like this. However I feel that this isn't correct.
An actor has an association with a CHOOSE TOOL use case and a CHOOSE TIME. An include statement is drawn from them to a CHECK AVAILABILITY use case.
I think first that the two use case to choose might be more accurately depicted in a single use case, but I can't think of how the availability is to be mapped. Should it be in the specification only?
I would post diagrams, but I don't have enough reputation to.
Welcome to Stackoverflow.
Make "Validate user login" a precondition to "make payment", i.e. do not make it an extra use case. The user will not validate that he himself is logged in, the system does that for him and it's trivial. The precondition is noted in the use case description.
"choose tool" <<include>>s "choose time". That is what the user needs to do, while
"check availability" is what the system does for the user. So that goes to the use case description as well, and is not a use case of its own.
"make payment" <<extend>>s "choose tool", of course.
Related
There is an exercise that requires us to draw a usecase diagram for a bank,
description says that a customer can make deposits and withdraw money. for that usecase scenario do i just draw
"make deposit" and "withdraw money" ? or should I <<'include'>> "update balance" function for both of them as well ?
There is a rule of gold that help me solve similar situations, hope it helps for you.
Use case definition: Series of interaction between an actor and the system to obtain added value.
So, as you can see there are interactions, basically a use case is a series of interactions.
Which interactions are for update balance? None, is just a calculation the system (as opposed to the actor) does.
Let's specify that use case under the assumption is a business use case and is a ATM.
1) Actor1 press 'start button'
2) The system show present card screen
3) Actor1 present card
4) System present menu with options...
5) Actor1 select withdraw .... ...
6) System present screen with updated
balance
7) Actor1 select ....
So this is quite visual, is not a Use case in the first place, becouse there are no interactions involved. So there is no need to check if bring added value or not. Is just an important part of one of the many interactions involved.
There are exceptions in which you may take that shortcut, such as if you want be more clear in the model or if you what to divide work based on Use cases. But IMHO that's not use case at all.
You may have 'Show balance', but it would be only one interaction, with the exception if you have options like "show on screen" or "paper-print on a ATM"
Hope it helps.
Is Update Balance a use case? Is there any added value for the actor? I guess not. It's a simple function which is performed as part of the other 2 use cases. You are trying (like most people) to perform functional decomposition. Just that two use cases share a common function does not make the function a use case. A use case is about added value which the system under consideration delivers to its actor(s). When you describe the scenario inside the use case, you might well refer to scenarios is other use cases. Each scenario step will end in an action. And you could simply refer to the action Update balance described in Make deposit when you describe Withdraw money. But the, Update balance is the result from a simple add operation. So why referring to that as a common function at all?
How to present on the diagram of use cases that
before any activity an actor needs to be logged in into the system?
e.g Use case "Display information about an employee" uses server and the another use case ("Search the employee in the database")?
Is my use case diagram correct?
You need to set pre-condition constraints for UCs telling { user must be logged on}.
Your UC diagram start resembling a spider's web (and is hardly recognizable). A good indicator that your design went wrong somewhere. Look at the single UCs and ask yourself: does this represent added value for the actor? If the answer is yes, you're fine.
After some zoom I see "Employee management", "Account management" and others that simply do not name UCs meaningful (they are likely processes). Use verb-substantive. And keep above question in mind.
A quick google indicates that use case preconditions are a useful way to represent the requirement that a user be logged in first. However, preconditions can clutter the UC diagram with text and possibly restrict the number of use cases on a particular diagram. I suggest creating a new actor that is an "authenticated user". This differentiates the actor from a user that has not yet logged in and allows clear representation of the use cases available to each.
I'm trying to write an use for shopping online . Customer can search for their desired item and add them to the shopping cart,but when they decide to check out, they need to log in with their account. But what happen if customer already logged in ? Is my diagram still correct ? If not, How can I modify it ?
Any use case must be connected to some actor(s). So, you should add connections.
The CheckOut use case is strange and inunderstandable. I don't know any action in net stores, that includes both login and payment. If you mean ordering, the login or payment are additional separate use cases, that are connected to ordering by some conditions that could be described as states.
Don't forget, you can't show sequences of actions and states by use cases elements only. If you have a small use case diagram, you could include state machine diagrams in it, but here it is not good - You have totally forgotten the admin and seller actors and their use cases, so the full use case diagram will be too large to add something extra in it. Describe sequences about logging in additional State Machine diagrams.
You are trying to use the use case diagram as a workflow editor, which is incorrect.
Use case diagrams are used to indicate the actions that a user can take to accomplish something. They do not represent the sequence of these actions. Each use case starts from a specific user action, and not as a side effect of another use case.
In your diagram, the "Search" use case is fine, but the display of the result is part of that use case. It would not be very useful if the system would just display a "search complete" result and then force the user to do some action to view the result... Although you have an <<include>> relationship, that it not what it means.
One example for <<include>> is one for a Login use case. The Customer could login on their own before doing anything else or the login could be triggered by another use case, such as Check Out. Login would therefore be a use case on its own and it would also be <<include>> by the Check Out use case.
Add to Cart is a use case that should be triggered directly by the Customer. It is not something that is triggered automatically - the Customer needs to do something.
The same applies to the Make Payment use case. I would think that the Customer needs to perform an explicit action in order to pay.
I'm setting the use cases of a project, here are some of the details :
My question is two parts :
first one :
I have an actor user.
The user can register on the website.
He can login, view profile, edit password.
Regarding the previous use cases, I'm confused how to visualize the use cases in the diagram, I was thinking it might be done like the following :
Create a use case "Manage Profile" and connect the other use cases "View Profile,Edit password, etc..." to it with a generalize relationship. and then connect that use case to the "loginCheck" use case with a "include relationship". The actor will indicate "manage profile".
Create a sub-system "Profile" and set the use cases related to within it. then connect it to "loginCheck" with "include relationship". The actor will indicate each use case.
second one :
The user can Add bet : there are some types of bets:
mutual bet :
1- single bets.
2- combination bets
long term bets
championship bets
Should I create a general use case "AddBet" and extend the other types to it.
I can't upload photo directly because I'm new .
First of all, For me I saw a lot of "link" inside your diagram which seems to be use in a wrong way. Maybe you can take a look at some UML ressources and more specifically, association, generalization, include and extend links... BTW I am just curious to know which tool do you use for this? Visio or ArgoUML?
So now concerning your(s) question(s).
When you want to associate an actor to an usecase you have to create an association between them not a generalization
If you want to specifiy that an "manage profile" use case can include (or not) changing password, view its profile, etc for this I would use an extend link.
For modelling the fact that an given use case mandatory include another one I would use include relationship.
the creation of an "add bet" use case "exntended" by the other one would indicate that you have a lot in commmon between all this possible bet.
Please take a look at my screenshots and let discuss about it.
On the Use case diag you should have only actors, visually different systems (such as terminal, client computer, server computer or Profile management system, Betting system ) and real-life actions(use cases).
Systems are shown as blocks, actors as people and use cases as ovals that connect sides of the action.
You should Profile Management as a system, as a protagonist in dialogue user-system. And you'll see, that Mobile bank is NOT a use case, is not an action. Maybe, it is another subsystem, or maybe simply won't belong there.
On your other diagram obviously different sorts of bets are descendents of the "bet" use case. They do not simply extend it.
You have many use cases not connecter to anybody. WHO does these actions? It is the target of UC diagram to show it.
Suppose we have a simple on-line store. Things that the user would want to achieve with the store would be:
Register (to create an account)
Browse items
Add items to basket
Checkout and pay
View account information
Edit account information
etc
However, there would be functionality that the user could initiate but wouldn't be their main goal of using the system:
Login
Logout
Select 'electronics' department
Select 'vehicles' department
Enter delivery details
etc
I would argue that things like login and logout shouldn't be in the UML use case diagram. The reason being that a user would not want to go to the on-line store just to login; they would always have another aim which would be to view / edit account information or browse and buy stuff.
Likewise, the two select 'statements' are part of the browse items use case. I wouldn't use generalisation because there could be many departments.
Finally, the enter delivery details is part of the 'checkout' or 'edit account information' use case. I would normally lump this in with the 'edit account information' use case otherwise you may as well have use cases for 'edit name', 'edit email' etc.
My main concern is if you have a very complex use case diagram it defeats the purpose of having one as it won't be easy to read.
So, my question is as follows. Is my thinking behind this correct? Is it best to only model 'real' goals in the use case diagrams or everything that the actors can initiate?
Does a UML use can show everything the actor can do (functionality) or
everything the actor wants to do (goals)?
It can be either - the UML spec isn't prescriptive on that front. Alistair Cockburn created a categorisation for Use Cases that indicates what level they focus on.
Having said that:
My main concern is if you have a very complex use case diagram it
defeats the purpose of having one as it won't be easy to read.
That's a very real risk. Personally I find I get most from UCs by focusing on the users and their goals. What value are they looking to get from the system?
Keeping it at that level prevents a "can't see the wood for the trees" situation - and also stops UCs becoming a complete, functional decomposition design.
hth.
It is not wrong to exclude some use cases from your diagram, and indeed it might be a good idea. For instance, if you are going to show your diagram to the business department, you can draw an UML model that describes the operational use cases. If you are going to hand down your diagram to the programmers, you would want to give them a complete description of what they have to implement. These are just models of your system.
When one draws a use case diagram, usually one also writes the behavior of each use case (as free-text description, pseudocode, or by using interaction diagrams).
The UML specification says that:
A use case is the specification of a set of actions performed by a system, which yields an observable result that is, typically, of value for one or more actors or other stakeholders of the system.
Login and Logout are observable to the user. While the user will not visit your site with the only goal of logging in, such use case certainly has some execution flow that you also want to describe. If you don't allow users to initiate a login by themselves, there will be use cases that include the functionality of login. A user may have also interest on logging out before leaving the site, so that no session data will remain stored in his computer.
Select 'electronics' department, Select 'vehicles' department... Why not just Select department (I suppose that they are not too different).
I would draw this and other use cases, as long as they are relevant to the model.