Book a Demo

Author Topic: Extends or Uses relationship  (Read 9016 times)

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Extends or Uses relationship
« on: July 14, 2008, 05:14:17 pm »
Hi everyone

I am producing some use cases for the user interface of our project

The user interface is hierarchical in its nature - i.e. Selecting one item on a menu results in a sub menu being displayed or an action being performed.

I have a use case that displays the main menu and another that performs the  actions associated with a particular menu item.

My question is this - is there an 'extends' or 'uses' relationship between these two use cases

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extends or Uses relationship
« Reply #1 on: July 14, 2008, 09:50:07 pm »
Hi Graham,

This is long-winded, but please bear with me.

The short answer to your question(s) is: Perhaps, but not really.

Note that the following is not meant to the 'gospel' of use cases, just to get you unstuck.

+++++
NOTE ALSO: I am not going to suggest a help text on use cases. There are several threads in the forum that provide many excellent suggestions, with discussion of strengths and weaknesses of each.

IMHO
Searching for these threads is well worth your time.

Helpful posters with yet another (probably repeated) suggestions would do well to search for one of these threads and add their suggestion if it is not already there, or their comments if it is. Posting a suggestion here (or in another thread that is not specifically for use case documentation suggestions) only serves to 'blur' the suggestions across the entire forum. This will quickly make finding a good set of suggestions essentially impossible.
+++++

Use cases are not meant to be procedural breakdowns of system usage. They should tell us what the 'users' (which for use cases includes other systems, components, and perhaps even events and triggers, as well as people) experience when interacting with a system, and what the system will do for those users. That said, you don't necessarily need to break a multi-tier menu down into multiple use cases.

As an example (somewhat contrived, to illustrate the point)...

Say a user needs to open a file via some kind of menu sequence like 'File | Open | Text File' where the final option is selected from a lower-level menu. [Perhaps there are other types of files, some of which may have even more detail at lower levels.]

In the above case just list the sequence of menu pads that the user must click, don't create cascading use cases. The use case you will end up with will illustrate a single interaction with the system - opening a text file - from start to finish; thus (exactly) one use case is needed, and appropriate. There is a success condition, which is that the user has successfully (perhaps chosen, depending on your system) and opened a text file. There are obvious situations that would constitute failure, and various alternate paths should be apparent. All of these are scenarios (or parts thereof) within the single use case.

As an informal test, imagine that we change the system to use an Open dialog. The user now sees a different (shorter) menu sequence and then a dialog. This is a small change to the use case, and should be well contained, perhaps in a preamble to the main scenario. The overall use case would remain the same. This makes sense, since the interaction described (between the use and the system, for the purpose of opening a text file) has not changed at all.

Note that you might have other use cases for different file types, or expand this single use case to handle all file types. This kind of decision depends on your organization, the end client of the system, the system itself, your methodology, and level of presentation and documentation you require.

Now, how to go about describing the system itself...

You could use more detailed use cases to drill down to how the menus work. These would not be connected to the above use case in the ways you describe. They would more likely be 'inner' use cases (at a lower model level) or connected by something like a «trace» or «realize» link. It might be (more) effective to use a different diagram type to drill down to the details, with or instead of low level use cases. Common choices include state models, activity diagrams, and sequence diagrams, though others are certainly possible.

EA makes the above situations easy to set up and visualize. Use composite elements or right-click a use case element and choose Add from the context menu - there's another level of menus there, but not another level of instruction (use case) since you're only doing one thing; you'll see.

HTH, David
No, you can't have it!

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #2 on: July 14, 2008, 10:04:08 pm »
Thanks David - you are helping me to see more clearly!

I originally thought along the following lines

UC Login <---includes---UC Test Menu <---includes--- UC Test Display
                                                                              UC Test Keyboar
                                    UC Next Menu

Now if I follow your advise I should not connect my use cases but document each as a standalone use case.
Have I understood you correctly

Graham

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extends or Uses relationship
« Reply #3 on: July 14, 2008, 11:20:57 pm »
Not quite.

For a moment, completely disregard the menus and associated dialogs themselves.

Now, what would the user want to do? [That is, what 'specific' task is the user going to perform? Note that the level of abstraction for use cases can differ, which affects the nature of the specific task illustrated. That's not something we'll get into here, since the overall concept holds up well across levels.]

If the current task is getting logged in, then limit the use case to whatever is involved in doing so. If there are a set of menu choices, list them all, but do not break them out into other use cases. The entire sequence is part of logging in; either you complete the sequence or the use case fails before you get to the end. If the menu sequence is completed correctly the user will be asked for credentials. At this point you might describe a login dialog, and list the information the user is required to supply. Be specific about whether the user must enter all the information at once, or if the system might validate the username and then wait for a password. [No, a login would not likely work that way, but I'm trying to point out that if such a variation were reasonable this is where you'd put it.] Assuming that the user enters valid credentials there should be some kind of successful outcome (user logged in, screen unlocked, whatever); let the reader know here. If there are additional actions that occur - something like allotting privileges depending on the account - then give an overview of the end result, but do not go into detail on how this is accomplished. That is for other aspects of your modeling project, at a lower level of detail. The use case tells what happens from the user's perspective. In this case the user is logged in, the system enables functions that require an account, and appropriate privileges are granted for this user session.

If there are error conditions then list these and (as appropriate) provide alternate scenarios. There might also be some alternate scenarios that result in success. All go into your use case.

If there were some menu choices that also apply to other use cases - unlikely here - and that did the same thing regardless of which interaction they were part of, then these could be split out into common sequences and referenced by an «include» link. Some other cases might be candidates for an «extend» link but this is a different kind of relationship. I'll leave you to read up on your own.

A candidate for an included use case might be opening a file, assuming that this might be done for various purposes throughout the system. Write and Open File use case, then «include» it in other use cases when a user must obtain such a file. Don't go into the menu sequence at all, other than as above. The menu is not what we're illustrating. The overall use of the system is the thing. Perhaps the 'including' use case is Edit Document, and it is necessary to get a file. You don't need to write use cases for each menu pad. Just tell the reader which ones you need to click. You might have some menu selections in the including use case and others in the included one; each should reference only those that are applicable.

Remember that if you change the login process later - perhaps a dialog might be presented to the user before the application main window is displayed; the application might simply exit if the login fails - then the overall use case is likely to change only in that we're not using a menu. You can reuse all the scenarios that deal with the 'actual' login process.

The above concepts of reuse and independence from implementation would also hold true for the Opening File use case, and for Edit Document. In each case we're trying to tell the reader what a user might do with the system and what the system will provide. The low-level specifics are less important here than describing the purpose and features of the system and the services it provides. All of this should be from a perspective of what difference the system will make, outside of the boundary of the system. That is, what's changed in the 'real world' by the use case.

David
No, you can't have it!

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #4 on: July 15, 2008, 12:12:43 am »
Hi David
Thanks for the additional info and your patience :)

I think that my problems are arising because I am redesigning an existing system so I know what the old UI looks like ..

I understand the Login use case you have proposed.

I think I undestand where to go with the rest -

We have a Test Menu item which includes options to perform certain tests.  I should have a seperate use case for each option and the scenario will say something like - "user selects Test Display from the Test Menu ...."

Is this better?

Graham

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extends or Uses relationship
« Reply #5 on: July 15, 2008, 05:41:22 am »
Yes. I think you're coming around to the correct viewpoint.

And that's just what it is, a point of view. Use cases are very much an 'outsider' as far as how they look at a system. Depending on what you need from a modeling paradigm this is either a weak point or a strength of UML. [The 'correct' answer is unimportant, particularly here. You just need to get going with use cases, not debate their merits.]

In no particular order...

Look at the Sparx Resources site, and check out their external links. Several of those sites also provide useful links.

Take a few minutes and look for the two or three long threads that deal with use case documentation recommendations. All were started a long time ago, and the most recent posts could be a year or two old. Once you find one of these threads you'll know you've make a hit. The threads are all extensive enough that any one thread will give you all the recommendations you need to get going.

David
No, you can't have it!

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #6 on: July 15, 2008, 05:25:09 pm »
Thanks David

I'll take a look at the treads  :D

BioformLivesAgain

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Extends or Uses relationship
« Reply #7 on: July 16, 2008, 11:16:07 am »
I think this is an example of classic miss-use-cases...

You might consider defining test cases, but this is not the purpose or scope level of use cases.

No offense, but you really need to understand the concept of a business and system use case.

Would recommend ANY books by Invar Jacobson (father of use cases) and also most use case books of the 3 amigo series are excellent.


Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #8 on: July 16, 2008, 04:33:56 pm »
No Offense taken

What use cases would you use to model a UI

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Extends or Uses relationship
« Reply #9 on: July 17, 2008, 11:22:05 pm »
Use cases do NOT model a UI.

Log in is not a use case. Try modeling "log out" as a use case.

A use case is a description of a goal, desired by a user, of the system.  

"ring mum" is a use case, "SMS Barbie" is a use case, "Book restaurant" is a use case.

"Turn on phone" is not a use case. "Buy phone with SMS capability" is not a use case.  "Dial restaurant" is not a use case,  "Log in" is not a @^&%% use case!@!@!!!!!!

Start with the first question.  What is this system supposed to do?  Take the requirements document and cross out everything that says "how" it's supposed to do it, then cross out everything that says what it's "not" supposed to do.  Then get a big red pen and cross out everything that says what its supposed to do when either the user or the system fails. If, and only if, you now have somewhere between 6 and 30 odd  things that its supposed to do, then start modeling use cases.
 
the ghost
 
... or putting it another way... the second thing I want when I wake up in the morning is a cup of tea, white with two sugars.  Design the system.
« Last Edit: July 17, 2008, 11:44:21 pm by sargasso »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extends or Uses relationship
« Reply #10 on: July 17, 2008, 11:33:06 pm »
Thanks ghost...

You've clarified the point I was trying to make. The use case is completely about what goal the 'user' is trying to accomplish (and how the user goes about 'using' the system to accomplish that goal). The use case is not about how the system goes about the work, just what is visible to the user within the context of the goal in question.

Details of the UI will be will be the result of design decisions, and on on how the system should best interact with the user. This will in turn be based on the use cases.

David

PS: It's been far too long, ghost, but it is good to know you're still haunting us.
No, you can't have it!

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #11 on: July 17, 2008, 11:49:41 pm »
OK

So I have a system (not a windows based system but an advanced vending application) that an engineer or operator can press a key on a key pad to display menu driven UI. Depending on whether it was an engineer or operator determines what options will be available.

One requirement is that the engineer can test certain components in the machine.

So the use case would be called 'Test water system' and will detail what the system must do in order to test the water system. Is that correct?
This use case should be written without reference to the UI?

How do I model the differences between operator and engineer operations?

Am struggleing to get my head around it

Graham

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Extends or Uses relationship
« Reply #12 on: July 18, 2008, 12:11:40 am »
So I have a system (not a windows based system but an advanced vending application) that an engineer or operator can press a key on a key pad to display menu driven UI. Depending on whether it was an engineer or operator determines what options will be available.

One requirement is that
do things.  If the user is an engineer then the engineer can test certain components in the machine.

So the use case would be called 'Test water system' and will detail what the system must do in order to test the water system. Is that correct?


Actor: Engineer
Actor: Operator

Use case: Test water system'
   Outcome: ???

Engineer --- <uses> --> (Test water system)
Operator --- <uses> --> ???


tg
« Last Edit: July 18, 2008, 12:15:57 am by sargasso »
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Graham_Labdon

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Extends or Uses relationship
« Reply #13 on: July 18, 2008, 12:37:50 am »
Thanks for your input

So within the use cases I make no mention of the possible UI components, only what the system must do to 'test the water system'??

Graham

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Extends or Uses relationship
« Reply #14 on: July 18, 2008, 01:58:49 am »
Only what the user[/i] must do with the application to get the water system tested. What the application will do and how it goes about doing that are the subject of other model components.

[Though what the user does to invoke the particular function, and how the user receives feedback from the application might be the subject of (detail-level only) use cases. At the level you seem to be talking of you might highlight these or leave them out altogether.

Bottom line: use cases are neither the design nor the specification of the system components; they are only the definition of what the system must accomplish, and how a user (in a broad sense) would go about getting the system to do these things.

Or: Simplified Procedure = Finish use cases; then start design.

David
« Last Edit: July 18, 2008, 01:59:52 am by Midnight »
No, you can't have it!