Feeds

Model use cases that work

Think succinct

Beginner's guide to SSL certificates

Use case modeling in practice

Here's an exercise from the book, on opening an account. See how many errors you can spot in the following use case, and try to rewrite the use case text - hint: this relates back to the items numbered 10 and three in our list. Once you're done, compare your rewritten version with our "fixed" version. Good luck!

BASIC COURSE: The system displays the Create New Account page and enters the following fields: Username (must be unique), password, confirm password, first name, last name, address (first line), address (second line), city, state, country, zip/postal code, telephone number, and e-mail address. Then the user clicks the Submit button; the system checks that the Username is unique, creates the new user account, and displays the main Hub Page, along with a message indicating that the user account is now created and logged in.

ALTERNATE COURSES: Password and Confirm Password don't match: The page is redisplayed with a validation message.
Username not unique: The page is redisplayed and the user is asked to choose a different username.

What's wrong? Answer: This use case gets bogged down in presentation details. It spends too long listing the fields to be found on the Create New Account page, with the result that the text doesn't follow a noun-verb-noun sentence structure.

Padded-out use cases of this sort often take up much more than two paragraphs. This doesn't help, as you want your use case to be succinct enough to translate to a single sequence diagram. We'll come back to this point in the fourth and final part of this series.

Instead, the fields should be added as attributes to the appropriate class in your domain model - most likely the Customer class. Then, when you need them later, they'll be right there. The fixed version follows.

BASIC COURSE: The system displays the Create New Account page and enters the fields to define a new Customer account. Then the user clicks the Submit button; the system checks that the Username is unique, creates the new user account, and displays the main Hub Page, along with a message indicating that the user account is now created and logged in.

ALTERNATE COURSES: Password and Confirm Password don't match: The page is redisplayed with a validation message.
Username not unique: The page is redisplayed and the user is asked to choose a different username.

In this excerpt we covered how to write the kinds of use cases that can be used to drive a software design. In the next installment we tackle robustness analysis, a form of preliminary design that helps to prepare your use cases for detailed design, testing and coding.

Use Case Driven Object Modeling with UML: Theory and Practice is available for purchase through Register Books, at the special price of £34.99. ®

Beginner's guide to SSL certificates

More from The Register

next story
Euro Parliament VOTES to BREAK UP GOOGLE. Er, OK then
It CANNA do it, captain.They DON'T have the POWER!
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
NSA SOURCE CODE LEAK: Information slurp tools to appear online
Now you can run your own intelligence agency
Post-Microsoft, post-PC programming: The portable REVOLUTION
Code jockeys: count up and grab your fabulous tablets
Twitter App Graph exposes smartphone spyware feature
You don't want everyone to compile app lists from your fondleware? BAD LUCK
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
prev story

Whitepapers

Designing and building an open ITOA architecture
Learn about a new IT data taxonomy defined by the four data sources of IT visibility: wire, machine, agent, and synthetic data sets.
Getting started with customer-focused identity management
Learn why identity is a fundamental requirement to digital growth, and how without it there is no way to identify and engage customers in a meaningful way.
5 critical considerations for enterprise cloud backup
Key considerations when evaluating cloud backup solutions to ensure adequate protection security and availability of enterprise data.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Driving business with continuous operational intelligence
Introducing an innovative approach offered by ExtraHop for producing continuous operational intelligence.