UML 2 Use Case Diagramming Guidelines

来源:百度文库 编辑:神马文学网 时间:2024/10/06 16:10:44

use case diagram is 揳 diagram that shows the relationships among actors and use cases within a system.?  Use case diagrams are often used to:

  • Provide an overview of all or part of the usage requirements for a system or organization in the form of an essential model or a business model
  • Communicate the scope of a development project
  • Model your analysis of your usage requirements in the form of a system use case model

 

 

A use case model is comprised of one or more use case diagrams and anysupporting documentation such as use case specifications and actor definitions. Within most use case models the use case specifications tend to be the primaryartifact with use case diagrams filling a supporting role as the 揼lue? thatkeeps your requirements model together.  Use case models should bedeveloped from the point of view of your project stakeholders and not from the(often technical) point of view of developers.  There are guidelines for:

  1. Use Cases
  2. Actors
  3. Relationships
  4. System Boundary Boxes

 

1.               Use Cases

A use case describes a sequence of actions that provide ameasurable value to an actor.  A usecase is drawn as a horizontal ellipse on a UML use case diagram, as you see in Figure 1.

  1. Use Case Names Begin With a Strong Verb
  2. Name Use Cases Using Domain Terminology
  3. Place Your Primary Use Cases In The Top-Left Corner Of The Diagram
  4. Imply Timing Considerations By Stacking Use Cases.  As you see in Figure 1, the use cases that typically occur first are shown above those that appear later. 

Figure 1. Implying timing considerations between usecases. 

 

2.               Actors

An actor is a person, organization, or external system thatplays a role in one or more interactions with your system (actors are typically drawn asstick figures on UML Use Case diagrams). 

Figure 2. Online shopping. 

 

  1. Place Your Primary Actor(S) In The Top-Left Corner Of The Diagram
  2. Draw Actors To The Outside Of A Use Case Diagram
  3. Name Actors With Singular, Business-Relevant Nouns
  4. Associate Each Actor With One Or More Use Cases
  5. Actors Model Roles, Not Positions
  6. Use <> to Indicate System Actors
  7. Actors Don抰 Interact With One Another
  8. Introduce an Actor Called 揟ime? to Initiate Scheduled Events

 

3.               Relationships

There are several types of relationships that may appear ona use case diagram:

  • An association between an actor and a use case
  • An association between two use cases
  • A generalization between two actors
  • A generalization between two use cases

Associations are depicted as lines connecting two modelingelements with an optional open-headed arrowhead on one end of the lineindicating the direction of the initial invocation of the relationship.Generalizations are depicted as a close-headed arrow with the arrow pointingtowards the more general modeling element.

 

Figure 3. Enrolling students in a university. 

 

  1. Indicate An Association Between An Actor And A Use Case If The Actor Appears Within The Use Case Logic
  2. Avoid Arrowheads On Actor-Use Case Relationships 
  3. Apply <> When You Know Exactly When To Invoke The Use Case
  4. Apply <> When A Use Case May Be Invoked Across Several Use Case Steps 
  5. Introduce <> associations sparingly
  6. Generalize Use Cases When a Single Condition Results In Significantly New Business Logic 
  7. Do Not Apply <>, <>, or <>
  8. Avoid More Than Two Levels Of Use Case Associations
  9. Place An Included Use Case To The Right Of The Invoking Use Case
  10. Place An Extending Use Case Below The Parent Use Case 
  11. Apply the 揑s Like? Rule to Use Case Generalization
  12. Place an Inheriting Use Case Below The Base Use Case
  13. Apply the 揑s Like? Rule to Actor Inheritance
  14. Place an Inheriting Actor Below the Parent Actor

 

4.               System Boundary Boxes

The rectangle around the use cases is called the systemboundary box and as the name suggests it indicates the scope of your system ?the use cases inside the rectangle represent the functionality that you intendto implement.  

  1. Indicate Release Scope with a System Boundary Box.  In Figure 2 you see that three system boundary boxes are included, each of which has a label indicating which release the various use cases have been assigned to. 
  2. Avoid Meaningless System Boundary Boxes.

 

5. Recommended Resources

  • Are You Ready For the MDA?
  • Be Realistic About the UML
  • Essential/Abstract Use Case
  • Examining The Model Driven Architecture (MDA)
  • Introduction to the Diagrams of UML 2
  • Introduction to Object Orientation (OO) and UML
  • Introduction to UML 2 Use Case Diagrams
  • Modeling Style Guidelines
  • Pavel Hruby's UML 2.0 Stencil for Visio
  • Roadmap for Agile MDA
  • System Use Case
  • Use Case Template: Formal
  • Use Case Template: Simple
  • Why Extend the UML Beyond Object and Component Technology?
  • XP and the UML?
  The Elements of UML 2.0 Style describes a collection of standards, conventions, and guidelines for creating effective UML diagrams. They are based on sound, proven software engineering principles that lead to diagrams that are easier to understand and work with.  These conventions exist as a collection of simple, concise guidelines that if applied consistently, represent an important first step in increasing your productivity as a modeler.  This book is oriented towards intermediate to advanced UML modelers, although there are numerous examples throughout the book it would not be a good way to learn the UML (instead, consider The Object Primer).  The book is a brief 188 pages long and is conveniently pocket-sized so it's easy to carry around.   The Object Primer 3rd Edition: Agile Model Driven Development with UML 2 is an important reference book for agile modelers, describing how to develop 35 types of agile models including all 13 UML 2 diagrams.  Furthermore, this book describes the techniques of the Full Lifecycle Object Oriented Testing (FLOOT) methodology to give you the fundamental testing skills which you require to succeed at agile software development.  The book also shows how to move from your agile models to source code (Java examples are provided) as well as how to succeed at implementation techniques such as refactoring and test-driven development (TDD).  The Object Primer also includes a chapter overviewing the critical database development techniques (database refactoring, object/relational mapping, legacy analysis, and database access coding) from my award-winning Agile Database Techniques book.   Agile Modeling: Effective Practices for Extreme Programming and the Unified Process is the seminal book describing how agile software developers approach modeling and documentation.  It describes principles and practices which you can tailor into your existing software process, such as XP, the Rational Unified Process (RUP), or the Agile Unified Process (AUP), to streamline your modeling and documentation efforts.  Modeling and documentation are important aspects of any software project, including agile projects, and this book describes in detail how to elicit requirements, architect, and then design your system in an agile manner.

 

 

6.Let Me Help

I actively work with clients around the world toimprove their information technology (IT) practices asboth a mentor/coach and trainer.  A full description ofwhat I do, and how to contact me, can befound here.