Sequence Diagram Tutorial. From: UML Distilled, Third Edition, Chapter 4 M. Fowler



Similar documents
Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers

Sequence Diagrams. Massimo Felici. Massimo Felici Sequence Diagrams c

Using UML Part Two Behavioral Modeling Diagrams

UML Tutorial: Sequence Diagrams.

Communication Diagrams

Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.

RULES FOR TEXAS HOLD EM POKER

Texas Hold em. From highest to lowest, the possible five card hands in poker are ranked as follows:

The cloth covering a Three Card Poker 6 Card Bonus table (the layout) shall have wagering areas for eight players.

Training Manual. Shuffle Master Gaming Three Card Poker Training Manual R

Object Oriented Programming. Risk Management

Design and UML Class Diagrams

UNDERGROUND TONK LEAGUE

Champion Poker Texas Hold em

[1] [2]

CPS122 Lecture: State and Activity Diagrams in UML

Standards of play: Type of gaming table utilized for this game:

Combinatorics 3 poker hands and Some general probability

3.1 Use Case Diagrams

How to Play Blackjack Alex Powell, Jayden Dodson, Triston Williams, Michael DuVall University of North Texas TECM /27/2014

HOW THE GAME IS PLAYED

UML TUTORIALS THE USE CASE MODEL

The Business Process Model

Ultimate Texas Hold'em features head-to-head play against the player/dealer and an optional bonus bet.

Voice Mail - Web PhoneManager (WPM) Rev. 8/4/15

CS 341 Software Design Homework 5 Identifying Classes, UML Diagrams Due: Oct. 22, 11:30 PM

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

NEC SV8100 Telephone System User Guide (for SV button and 24-button phones)

Object of the Game The object of the game is for each player to form a five-card hand that ranks higher than the player-dealer s hand.

How To Create A Diagram On Rational Software Development Platform

Contents. Note: Feature commands and/or functionality may vary dependent on the telephone equipment you choose to use with this product.

Note: To increase your bet by another amount, select another chip from the bottom right of the game panel.

Aspect Oriented Strategy to model the Examination Management Systems

Casino Control (3 Card Poker) Approval 2006 (No 1)

Object Interaction. Object Diagrams. Object Diagrams Object

Basic Unified Process: A Process for Small and Agile Projects

The game of roulette is played by throwing a small ball onto a rotating wheel with thirty seven numbered sectors.

on a table having positions for six players on one side of the table 1. A true to scale rendering and a color photograph of the

Bonus Maths 2: Variable Bet Sizing in the Simplest Possible Game of Poker (JB)

UML basics: An introduction to the Unified Modeling Language

Using Rational Rose to Create Object-Oriented Diagrams

UM8000 MAIL USER GUIDE

2urbo Blackjack Hold their face value

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

After 3 races the player with the highest winnings has won that day s racing.

Interaction Diagrams. Use Cases and Actors INTERACTION MODELING

Communications Software Engineering Design Model

Using UML Part One Structural Modeling Diagrams

PENNSYLVANIA GAMING CONTROL BOARD REMAINING TEMPORARY TABLE GAMES REGULATIONS TITLE 58. RECREATION CHAPTERS: 581, 583, 585, 587, 588, 589,

ALGORITHMS AND FLOWCHARTS

$ ( $1) = 40

Special Notice. Rules. Weiss Schwarz Comprehensive Rules ver Last updated: October 15 th Outline of the Game

Chapter 4 Software Lifecycle and Performance Analysis

one Managing your PBX Administrator ACCESSING YOUR PBX ACCOUNT CHECKING ACCOUNT ACTIVITY

1 Hour, Closed Notes, Browser open to Java API docs is OK

Object-Oriented Design Guidelines

Game Theory and Algorithms Lecture 10: Extensive Games: Critiques and Extensions

Sticky Note Bingo (Cover Up)

User experience storyboards: Building better UIs with RUP, UML, and use cases

NEC SV8100 Telephone System User Guide (for SV button and 24-button phones with CAP/PARK keys)

First Grade Exploring Two-Digit Numbers

Features & Instructions Guide For Your New VoIP Services

Course Registration Case Study

TRANS-VIDEO PHONE SERVICE

Hosted PBX End User Training Guide For the Polycom Soundpoint IP 321, 331 and 335 Phone

ChE-1800 H-2: Flowchart Diagrams (last updated January 13, 2013)

TDDC88 Lab 2 Unified Modeling Language (UML)

Home Phone Call Forward Guide

Please let us know if you need anything. Our customer service number is We re always happy to help.

Probabilities of Poker Hands with Variations

Minimax Strategies. Minimax Strategies. Zero Sum Games. Why Zero Sum Games? An Example. An Example

Address Book. Store all of your contacts in your online Address Book.

UML basics. Part II: The activity diagram. The activity diagram's purpose. by Donald Bell IBM Global Services

Everyday Math Online Games (Grades 1 to 3)

Adding and Subtracting Integers Unit. Grade 7 Math. 5 Days. Tools: Algebra Tiles. Four-Pan Algebra Balance. Playing Cards

LIVE CASINO HOLD EM. Live Casino Hold em five-card poker, world-class quality. As real as it gets BENEFITS AT A GLANCE.

GAME DESCRIPTION AND RULES HOLD'EM

There are a number of superb online resources as well that provide excellent blackjack information as well. We recommend the following web sites:

PowerPoint 2007: Animations Contents

UML Tutorial: Part 1 -- Class Diagrams.

Five9 Virtual Contact Center

How To Draw A Cell Phone Into A Cellphone In Unminimal Diagram (Uml)

Math Games For Skills and Concepts

Commission-Free. Baccarat Dragon Bonus

Tutorial - Building a Use Case Diagram

The game also features three optional bonus bets.

Voice Mail User s Guide (FACILITY NOT AVAILABLE IN RESIDENCES)

TEXAS HOLD EM POKER FOR SIGHT

Random Fibonacci-type Sequences in Online Gambling

E XPLORING QUADRILATERALS

Use Cases and Scenarios

LIVE CASINO 1. ROULETTE GAME RULES. 1.1 Game Overview. 1.2 How to Play. 1.3 Bet Type Explanation

The resulting tile cannot merge with another tile again in the same move. When a 2048 tile is created, the player wins.

16. Recursion. COMP 110 Prasun Dewan 1. Developing a Recursive Solution

How to Play. Player vs. Dealer

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

Transcription:

Sequence Diagram Tutorial From: UML Distilled, Third Edition, Chapter 4 M. Fowler

Use Cases and Scenarios A use case is a collection of interactions between external actors and a system In UML, a use case is the specification of a sequence of actions, including variants, that a system (or entity) can perform, interacting with actors of the system. Typically each use case includes a primary scenario ( or main course of events) and zero or more secondary scenarios that are alternative courses of events to the primary scenario. In RUP (Rational Unified Process), user requirements are captured as use cases that are refined into scenarios. Then: A scenario is one path or flow through a use case that describes a sequence of events that occurs during one particular execution of a system.

UML Sequence Diagrams Describe the flow of messages, events, actions between objects Show concurrent processes and activations Show time sequences that are not easily depicted in other diagrams Typically used during analysis and design to document and understand the logical flow of your system Emphasis on time ordering!

Sequence Diagram Key Parts participant: object or entity that acts in the diagram diagram starts with an unattached "found message" arrow message: communication between participant objects the axes in a sequence diagram: horizontal: which object/participant is acting vertical: time (down -> forward in time)

Sequence Diagram (make a phone call) Caller Phone Recipient Picks up Dial tone Dial Ring Ring notification Picks up Hello Hello

Representing Objects Squares with object type, optionally preceded by "name :" write object's name if it clarifies the diagram object's "life line" represented by dashed vert. line

Messages Between Objects messages (method calls) indicated by arrow to other object write message name and arguments above arrow

Messages, continued messages (method calls) indicated by arrow to other object dashed arrow back indicates return different arrowheads for normal / concurrent (asynchronous) calls

creation: arrow with 'new' written above it Lifetime of objects notice that an object created after the start of the scenario appears lower than the others deletion: an X at bottom of object's lifeline Java doesn't explicitly delete objects; they fall out of scope and are garbage-collected

Indicating method calls activation: thick box over object's life line; drawn when object's method is on the stack either that object is running its code, or it is on the stack waiting for another object's method to finish nest activations to indicate recursion Activation Nesting

Selection and loops frame: box around part of diagram to indicate if or loop if -> (opt) [condition] if/else -> (alt) [condition], separated by horizontal dashed line loop -> (loop) [condition or items to loop over]

Sequence diagram from use case scenario

Why not just code it? Sequence diagrams can be somewhat close to the code level. So why not just code up that algorithm rather than drawing it as a sequence diagram? a good sequence diagram is still a bit above the level of the real code (not all code is drawn on diagram) sequence diagrams are language-agnostic (can be implemented in many different languages non-coders can do sequence diagrams easier to do sequence diagrams as a team can see many objects/classes at a time on same page (visual bandwidth)

Sequence Diagram Exercise Let's do a sequence diagram for the following poker casual use case, Start New Game Round : The scenario begins when the player chooses to start a new round in the UI. The UI asks whether any new players want to join the round; if so, the new players are added using the UI. All players' hands are emptied into the deck, which is then shuffled. The player left of the dealer supplies an ante bet of the proper amount. Next each player is dealt a hand of two cards from the deck in a round-robin fashion; one card to each player, then the second card. If the player left of the dealer doesn't have enough money to ante, he/she is removed from the game, and the next player supplies the ante. If that player also cannot afford the ante, this cycle continues until such a player is found or all players are removed.

Poker sequence diagram

Sequence Diagram Question Consider the possible poker use case, Betting Round : The scenario begins after the Start New Round case has completed. The UI asks the first player for a bet. That player chooses to either bet a given amount, or check (no bet). The next player is asked what to do. If the prior player placed a bet, the next player must either match ("see") it, or match it plus add an additional bet ("raise"), or choose not to match and exit the round ("fold"). This continues around the table until an entire pass is made in which all players have either matched all other players' bets or folded. If the next player doesn't have enough money to match the current bet, the player is allowed to bet all of their money. But they can then win only up to the amount they bet; the rest is a "side pot" among the more wealthy players remaining in the round. Why is it hard to diagram this case as a sequence diagram?

Poker Sequence Diagram 2