Meaningless Drivel is fun!*
The moose likes OO, Patterns, UML and Refactoring and the fly likes  basic use case doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark " basic use case doubt" Watch " basic use case doubt" New topic
Author

basic use case doubt

Rahul Siddharth
Ranch Hand

Joined: Feb 17, 2007
Posts: 33
Hello everyone.

I'm new to UML but basically a developer.I have a jsp in which I had 2 functions, one to add and the other to modify an account.Do I need to write two use cases(1.add,2.modify) or just one use case that describes both the functions?.

Thanks in advance.
Rajah Nagur
Ranch Hand

Joined: Nov 06, 2002
Posts: 239
I would say you require 2 use cases, because Each use case should describe how the actor will interact with the system to achieve a specific goal
[ August 11, 2008: Message edited by: Rajah Nagur ]

You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

As a Craig Larman adept, I would suggest to use one use case for this goal.

A common exception to one use case per goal is to collapse CRUD (create,
retrieve, update, delete) separate goals into one CRUD use case, idiomatically
called Manage <X>.


OCUP UML fundamental and ITIL foundation
youtube channel
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
I have a jsp in which I had 2 functions, one to add and the other to modify an account.Do I need to write two use cases(1.add,2.modify) or just one use case that describes both the functions?.


First, you should move these functions to a servlet. A Java Server Page should be used for displaying information and providing a GUI for humans to send data to a web server via HTML forms.

Second, since adding an account and modifying an account are two distinctly different operations, you should write two Use cases.
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
Originally posted by Jan Cumps:
As a Craig Larman adept, I would suggest to use one use case for this goal.


Technically, these are two separate goals that a user wishes to accomplish when interacting with the system, so they are at least conceptually two separate use cases. While there may be some advantage to collapsing them in the short term due to minimized redundant text, I think you're better off working these separately and using "includes" sections for common portions.

I think in general that you want to avoid "if" clauses in a use case. For example, the use case for "add account" may require an external lookup to a credit service, but this would not be appropriate for a "change account" use case.

Jeff


Books: Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: basic use case doubt
 
Similar Threads
UML - Use Case
Problem of Use Case
Can I add New Use Cases ?
Use case in SCEA Part 2
UML Use Case....need help again