Introduction to Sequence Diagrams

Slides:



Advertisements
Similar presentations
1 Advanced with GMail A CYC Electives Module
Advertisements

® Microsoft Office 2010 Browser and Basics.
PantherSoft Financials Smart Internal Billing. Agenda  Benefits  Security and User Roles  Definitions  Workflow  Defining/Modifying Items  Creating.
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Library Online Catalog Tutorial Pentagon Library Last Updated March 2008.
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
Software Engineering COMP 201
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
Requirements Analysis 1 Use Cases -> Class Diagrams Moving from the user towards the system.
From Class Diagrams to Databases. So far we have considered “objects” Objects have attributes Objects have operations Attributes are the things you record.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
Thredz Thredz is a successful costume hire business. Its customers range from theatre companies, who hire large numbers of outfits for periods of several.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Library & Information Services Using the Library Catalogue Part 2: My Account Reserving Items Reading lists Rachael Hartiss 2008.
Advanced Last Updated: May Class Outline Part 1 - Review –Review of basics –Review of files and folders Part 2 - Attachments –Sending.
What is so good about Archie and RevMan 5
Garland Library Online Orientation. Introduction  This portion of the Online orientation is intended to help library users gain the basic knowledge and.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Introduction to WebCT Sheridan College Architectural Technology.
Object-Oriented Analysis and Design
Textbook Management and the Insignia Library System.
Use Case Analysis From soft systems methodology to understanding the system functionality.
PRIOS ARA Limited Agent User Instructions PRIOS ARA Limited Agent User Instructions Professional Repossessors Interactive Operating System.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
The Vision SSM Models Databases Use Cases Programs Activity Models
1 CMPT 275 Phase: Design. Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces Data Persistance.
Hunter Valley Amateur Beekeepers Forum User Guide Guide shows sample screenshots with most relevant actions. Website is at
How to Fill a Reserve Request Part 3 of the Series on Reserves Using Agent VERSO.
1 Sub-Phase Low Level Design (cont). Janice Regan, Map of design phase DESIGN HIGH LEVEL DESIGN Modularization User Interface Module Interfaces.
1 of 8 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 CMPT 275 Software Engineering Requirements Gathering Activity Janice Regan,
Setting Up Alerts and Dashboard Links. When you first start using the Active Orders system, you will need to establish the settings for two types.
SIGNZ Mail Merge / Merge / Labels SIGNZ Mail Merge / Merge / Labels.
IPortal Bringing your company and your business partners together through customized WEB-based portal software. SanSueB Software Presents iPortal.
TST BOCES SCOOLS (South Central Organization of (School) Library Systems) INTERLIBRARY LOAN PROCESS…..An Overview Created by Michele Barr, TST ILL Login.
1 Object-Oriented Modeling Using UML CS 3331 Section 2.4 Modeling Requirements with Use Cases.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
1 Examining Execution Sequences Introducing Sequence Diagrams.
G045 Lecture 08 DFD Level 1 Diagrams (Data Flow Diagrams Level 1)
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Use Case Diagrams.
ASU Rosters for Roster Contacts Class Roster ASR Roster Grade Roster Grade Changes.
Faculty Center for Instructors Roles and Access Faculty Center Features Grade Changes and Approval.
Object-Oriented Analysis and Design Use cases Finding classes Collaboration and Sequence diagrams Associations between classes.
PestPac Software. Leads The Leads Module allows you to track all of your pending sales for your company from the first contact to the close. By the end.
Complete Ordering System for Promotional Literature and Samples Quick Reference and Training Guide.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| WISL |||||||||||| 1 User Commands WISL Demos.
Invoices Training Presentation for Supply Chain Platform: BAE Systems May 2015.
Use Case Diagrams A Detailed Description. Use Case Diagrams Use case diagrams describe relationships between users and use cases A use case is a (usually.
Assignments, Assessments and Grade Book
An informal, team oriented, OO design system
Use Case Diagram Example
Project Management: Messages
CS3035 Beacon Module 8 Credit/Collections
Single Sample Registration
UML Use Case Diagrams.
Active Orders Supplier Administrator Training Getting Started Activities This training presentation describes the Getting Started activities that will.
Oracle Sales Cloud Sales campaign
Week 12: Activity & Sequence Diagrams
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Introduction to Database Programs
Introduction to Database Programs
PubMed/How to Search, Display, Download & (module 4.1)
Presentation transcript:

Introduction to Sequence Diagrams

The Vision SSM Models Databases Use Cases Programs Activity Models Object Models Dynamic Models Computing Business

Beginnings of a Method Soft Systems Model

Systems Activities The systems functionality is represented as a number of Use Cases The functionality of each use case will be realised through objects collaborating with each other Collaboration is achieved through message passing

Message Connections The arrow indicates that: The sender sends a message The receiver receives the message The receiver takes some action, returning the result to the sender

Message Connections The message must activate an operation in the receiving object

Message Connections There are two ways of knowing which object to send a message to: (1) An association exists between sender and receiver in the object model (2) The receiver’s object id is passed as part of the message (i.e. as a parameter)

Message Connections Sequence Diagrams allow us to describe object communication associated with a specific use case Can be used: during analysis to help define an object's responsibilities as documentation for the final implemented software

Example Object Model

Sequence Diagram for Placing an Order

Placing an Order A message is sent to the order class to create a new “order” Customer No., Stock items and Quantities are passed as parameters Customer details are retrieved from the appropriate customer object For each stock item an order line object is created Details are extracted from the stock item object

Another Example - A Library We have identified three objects: Borrower, Book and Librarian and the following relationship: 0..1 Borrower Book n

Library Example Issuing a Loan Triggered by a request from a Borrower for the loan of a Book. Before issuing the loan we need to check:

Library Example 1) The borrower has no overdue fines 2) The borrower has not already reached the maximum number of loans that they are allowed. 3) None of the borrower’s current loans are overdue

Issue Loan - Sequence Diag.

Library Example Borrower Book Fines Owing Borrower No. Our object model must be consistent with the interaction diagram Borrower Book 0..1 Fines Owing Borrower No. Max. No. of Loans Date Due n Add Book to Loan List Check if overdue Check Loan Status Issue to Borrower Librarian Issue Loan

Library Example Each of the operations in our model needs to be documented with pseudocode e.g. Borrower::Add Book to Loan List Receives a book id and then adds this to the collection of books linked to borrower

An Example Program

Another Student

The Underlying Database

The Program that uses the Database

The Class Diagram

Get Group Student Numbers Get Student Number

Get Module Results Get Student Marks

Three Tiers

Exercise Each Instructor has a name, address and telephone number and is qualified to present one or more courses. We store the date when the instructor became qualified to teach the course A course has at least one instructor qualified to teach it but it may have many  Each course has a number, title and a date of next revision Each course will have several scheduled presentations Details of the date, duration and location are recorded for each presentation Each presentation will be given by only one instructor but one instructor may give many presentations

The “Reschedule Presentation” use case   Sometimes a presentation needs to be rescheduled when this happens the availability of the existing instructor needs to be checked. If they are available they are assigned to the presentation on the new date. If not we need to release the current instructor, find all other qualified instructors and check their availability to identify a replacement.

Use Case – Reschedule Presentation Initial Class Diagram 1 0..n 1 1 1..n 1..n 1

After much discussion…

Developing Sequence Diagrams Identify the relevant objects involved in the computation Establish the role of each object Identify the controller Identify the collaborators Decide on the messages between objects

Sequence diagram notation Actors :Object 1 :Object 2 Objects

Sequence diagram notation :Object 1 :Object 2 Lifelines Identify the existence of the object over time.

Sequence diagram notation :Object 1 :Object 2 Activations Indicate when an object is performing an action

Sequence diagram notation :Object 1 :Object 2 message Messages Indicate the communications between objects

Sequence diagram notation :Object 1 :Object 2 message message Sequence Vertical position signifies sequence – earlier messages appear nearer the top.

Sequence Diagram Tracks a sequence of events in a scenario Identifies all objects involved Objects O1 O2 O3 O4 O5 indicates that the event effects the object Events E1 E2 E3 E4

Sequence modelling For each event, ask “what objects does this involve?” Used to identify new classes Determines how classes interact

Use case elaboration We define use cases as sequences - primary and alternative paths Now we take sample sequences and build sequence diagrams This gives us the objects And it gives us the relationships And it gives us the operations

Invoicing use case (1)

Invoicing use case (2)

The Primary Path The following sequence is carried out for every customer on the sales ledger who has not been billed in the last month: Get sales items from the sales ledger. Get customer details from the customer file, covering billing address details. Get any credits that the customer has. Get discount details for customer. Print the invoice header Print the line items on the invoice Calculate any discounts Apply any credits Calculate and print the invoice total Calculate and print the VAT Mark items on sales ledger as invoiced

Now we can realise the use case Elaborate the scenario with sequence diagrams Find objects Add operations to objects Add attributes to objects

Sequence diagram for Print Invoice use case In recent years many OO gurus have suggested that we should introduce a control class for each Use Case. The control class drives the processing. : Print Invoice For interactive use cases there is usually a boundary class too. We can put this object in a class diagram

Print Invoice - class diagram From our sequence diagram, we find our first object! Print Invoice

And then we need a recipient of the message. : Print Invoice : Customer Record Get Customer Name Now we implement the first step of the scenario by getting the Print Invoice control class to send a message. And then we need a recipient of the message. So we have found another object

Print Invoice - class diagram Customer Record We can see that as the objects communicate we need a relationship between them.

Moving on to the next step of the scenario : Print Invoice : Customer Record : Invoice Get Customer Name Print Customer Name Moving on to the next step of the scenario We now have a third object!

Print Invoice - class diagram Customer Record Now we add in our third object Invoice And because the message comes from Print Invoice to Invoice, they need to be related

So we continue! : Print Invoice : Customer Record : Sales Items Get Customer Name Print Customer Name Get Customer Address Print Customer Address Get Unbilled Invoicable Items Print Invoice Lines Print Total Print Terms and Conditions So we continue!

Print Invoice - class diagram We need one more object Print Invoice Customer Record Sales Items Invoice Which is related to Print Invoice

So what have we done? Worked through a Use Case scenario step by step Introduced a controller object to drive things Sent messages from one object to another Found objects to deal with the messages Put the objects and necessary relationships on a class diagram

What have we got left to do? Find operations on objects to support the messages Find attributes to support the objects

So we work through the messages and apply operations : Print Invoice : Customer Record : Sales Items : Invoice GetName( ) So we work through the messages and apply operations

Print Invoice - class diagram And then we have an operation for our class diagram Customer Record Print Invoice GetName() Invoice Sales Items

And so we continue : Print Invoice : Customer Record : Sales Items GetName( ) PrintCustName( ) And so we continue

Print Invoice - class diagram And we add the next operation to the class diagram Customer Record Print Invoice GetName() Invoice Sales Items PrintCustName()

And all the way through the sequence diagram : Print Invoice : Customer Record : Sales Items : Invoice GetName( ) PrintCustName( ) GetAddress( ) PrintCustAddress( ) GetUnbilledItems( ) PrintLines( ) PrintTotal( ) PrintTermsConditions( ) And all the way through the sequence diagram

Print Invoice - class diagram We can put an operation on Print Invoice to implement this And then add the other operations to the class diagram Customer Record Print Invoice GetName() Print() GetAddress() Invoice Sales Items PrintCustName() getItems() PrintCustAddress() GetUnbilledItems() PrintLines() PrintTotal() PrintTermsConditions()

A Simpler Example - Sending an email

E-mail interface

Working from a scenario Sending an email 1. Press “New ” email icon 2. Enter person’s name in “To” section 3. Type subject 4. Type contents 5. Press Send button 6. System looks up email address in address book 7. System submits the email to the email server

Starting the diagram If this is an interactive scenario, we always have an actor driving it, so we put one on the sequence diagram

Add objects The first interaction is with the icon bar, which we can treat as an object

The user talks to the icon bar Add message The user talks to the icon bar

Label the communication Remember that actors can only communicate with interface objects such as screens, menus and icon bars.

The icon bar has some work to do. It creates an email page. Now the user can see the email page and use it.

The next three steps are filling in the details on the email page

The user then clicks Send

Now consider how to do the sending We can choose to get the email page to look up the email address from an address book object

The arrow allows information to return So we don’t need to put a return arrow with the email address going back to the email page

We can choose to get the email page to submit the email to the email server

And if we think carefully, the email page always closes after the send.

Now we go through and change the messages to operations on the object

And so on, all the way through

And now we have found our objects, and the operations on them So we drag them onto a class diagram

The icon bar needs to communicate with the email page We could use an arrowed relationship, but we generally don’t

Likewise the email page communicates with the address book and email server

Then we worry about multiplicity

Developing a Sequence Diagram Work through a scenario step by step Make actors communicate with screens, icons, menus Make the screen actions (etc) trigger actions with objects Convert the actions to operations

Class diagrams Objects from the sequence diagram go on a class diagram. Operations are added automatically by the CASE tool (e.g. Together) Examine the sequence diagram to see where the communication takes place. Add relationships, and consider multiplicity.

Sequence Diagrams – why bother? Tie use cases and object models together Use the sequences in use cases Identify objects Identify relationships Identify operations

Beginnings of a Method Soft Systems Model