CS12420 Sequence Diagrams – a UML notation for modelling bahaviour Lynda Thomas Images from Wikipedia unless credited or mine.

Slides:



Advertisements
Similar presentations
PROBLEM SOLVING TECHNIQUES
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Algorithms and Problem Solving
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 2- Visual Basic Schneider
Chapter 9 Describing Process Specifications and Structured Decisions
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
CS211 Data Structures Sami Rollins Fall 2004.
1 COMP541 State Machines Montek Singh Feb 6, 2007.
1 Intro to Finite Automata Chapter 2 introduces the concept of a Finite Automata (or FA). An FA has several properties: It is theoretical. It allows computer.
An Overview of Programming Logic and Design
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Introduction.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Review Algorithm Analysis Problem Solving Space Complexity
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Sequence Diagram Tutorial
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
Chapter 9 Describing Process Specifications and Structured Decisions
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Chapter 11 Describing Process Specifications and Structured Decisions Systems Analysis and Design Kendall and Kendall Fifth Edition.
General Programming Introduction to Computing Science and Programming I.
Chapter 2 - Algorithms and Design
HFOOAD Chapter 2 Requirements. We create software for a reason. We create software fro people. We need to know what the people want in the software we.
Lecture 2: Classes and Objects, using Scanner and String.
Requirements Analysis Visual Modeling] Lab 02 Visual Modeling (from Visual Modeling with Rational Rose and UML) A way of thinking about problems using.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
BIT 286: Web Applications Software Design Documents.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Alternating Series.
Chapter 5 Models and UML Notation for The Object-Oriented Approach.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
CS 4850: Senior Project Fall 2014 Object-Oriented Design.
1 Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping.
Use Case Model Use case diagram.
Unit 2 – Algorithms & Pseudocode. Algorithms Computer problems solved by executing series of action in order Procedure –The Actions to execute –The Order.
The Software Development Process
ITEC324 Principle of CS III Chapter 2 (Horstmann’s Book) – Part 1 The Object-Oriented Design Process Hwajung Lee.
 2002 Prentice Hall. All rights reserved. 1 Chapter 4 – Control Structures Part 1 Outline 4.1 Introduction 4.2 Algorithms 4.3 Pseudocode 4.4 Control Structures.
The Art of Programming. The process of breaking problems down into smaller, manageable parts By breaking the problem down, each part becomes more specific.
A First Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Credits: a significant part of.
The Hashemite University Computer Engineering Department
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
Programming Objectives What is a programming language? Difference between source code and machine code What is python? – Where to get it from – How to.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
In today’s lesson we will be looking at: what we mean by the software development lifecycle the phases in the lifecycle We will focus particularly on testing:
Unit 1 Logical operators.
Component 1 Logical operators.
Component 1.6.
Data Types Variables are used in programs to store items of data e.g a name, a high score, an exam mark. The data stored in a variable is entered from.
Use Case Model Use case diagram.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 4 – Control Structures Part 1
Algorithm and Ambiguity
While loops The while loop executes the statement over and over as long as the boolean expression is true. The expression is evaluated first, so the statement.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Programming in Pseudocode
Chapter 2- Visual Basic Schneider
Designing the Workflow
Chapter 2- Visual Basic Schneider
Programming.
Chapter 11 Describing Process Specifications and Structured Decisions
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Programming Logic and Design Eighth Edition
Presentation transcript:

CS12420 Sequence Diagrams – a UML notation for modelling bahaviour Lynda Thomas Images from Wikipedia unless credited or mine

Current UML - recap Class diagrams tell you: –the static structure of the system –the relationships between the data –the methods give clues to what can happen Object diagrams tell you: –A snapshot of how the system might look at some point in time

Class Diagram Object Diagram

How do you model what happens in a software system? Use Case diagram tells you: –Who the actors are in the system –What they can do This is really an analysis diagram

But that doesn’t tell you design i.e. in what order things happen or how to write the methods

Sequence diagrams do that Let’s use google ary/3101.htmlhttp:// ary/3101.html Diagram.htmhttp:// Diagram.htm

TIMETIME

So the basic idea is that it shows ‘what happens when’ Phone Example is ‘above’ the specific design level of a program – more like analysis Sequence Diagrams can be at any level actually – analysis or design and help you ‘get your head around’ what is happening Consider the procedure for applying to university through UCAS – let’s try it

But usually used to look at how objects in an OO system interact Let’s have a look at the.pdf file /Sequence%20Diagram%20Tutorial.pdf for the syntax /Sequence%20Diagram%20Tutorial.pdf

Cute (but just noticed error) - Three Little Pigs

Why not just code it? Sequence diagrams describe single use cases showing the behaviour across objects of many classes can see many objects/classes at a time on same page good sequence diagram is still a bit above the level of the real code can be implemented in many different languages non-coders can do sequence diagrams easier to do sequence diagrams as a team

An example CS122 exam: The translation unit. Ordinary users of the unit can look up Welsh and English words and phrases and get their translation. They can also submit documents for translation (in the direction Welsh to English or English to Welsh) and find out whether those translations are complete, in process or not started……. Let’s add a new functional requirement: Users can submit and get an emergency translation of a document

0..* -dictionary 0..* -myDocs trans Application //runs menu +emerTrans (): void LinguisticUnit //a word or phrase DocumentInfo//information about document +DocumentInfo(String docName, String whichDirection, String uid, Date dateSubmitted) + String getDocName() + void setCheckedOut(Translator translator) +Translator getTranslator() + void setCompleted() + boolean isCompleted() + Date getDate() + String toString() Translator //stores all info -String uid -String phone Model //holds data * -translators 0..* -allDocs +doEmerTrans (): void

0..* -dictionary 0..* -myDocs trans Application //runs menu +emerTrans (): void LinguisticUnit //a word or phrase DocumentInfo//information about document +DocumentInfo(String docName, String whichDirection, String uid, Date dateSubmitted) + String getDocName() + void setCheckedOut(Translator translator) +Translator getTranslator() + void setCompleted() + boolean isCompleted() + Date getDate() + String toString() Translator //stores all info -String uid -String phone Model //holds data * -translators 0..* -allDocs +getFreeTrans (): Translator +doEmerTrans (): void

aTrans=

0..* -dictionary 0..* -myDocs trans Application //runs menu +emerTrans (): void LinguisticUnit //a word or phrase DocumentInfo//information about document +DocumentInfo(String docName, String whichDirection, String uid, Date dateSubmitted) + String getDocName() + void setCheckedOut(Translator translator) +Translator getTranslator() + void setCompleted() + boolean isCompleted() + Date getDate() + String toString() Translator //stores all info -String uid -String phone Model //holds data * -translators 0..* -allDocs +getFreeTrans (): Translator +doEmerTrans (): void +doEmer(DocInfo d): void

Alternatives? Interaction diagrams do the same sort of job Take an object diagram and draw numbered arrows I think they are harder to understand but easier to write

Detailed: Initialize total to zero Initialize counter to zero Input the first grade while user has not as yet entered the sentinel add this grade into the running total add one to the grade counter input the next grade (possibly the sentinel) if the counter is not equal to zero set the average to total /counter print the average else print 'no grades were entered' Pseudocode can be used at any level (code w/out syntax) Higher Level: (doEmerTrans() of Model) aDoc=new DocInfo(…) aTrans= freetranslator() checkout aDoc to aTrans aDoc.setCompleted() That tells me that I need to look further at freetranslator() (easy) and at checkout() … Decide to use setCheckedout(aTrans) in DocInfo … here is pseudocode translator=aTrans translator.doEmer() Now need to elaborate doEmer() in Translator

Here is a vending machine State diagrams look at the internals of an object – more next year

Flow charts don’t work as well with objects but can be useful for detailed logic

There are tools for this Tools to help produce them Tools to produce code from them Tools to take code and produce diagrams

What do I honestly use to design? Start usually with a rough use case diagram then a very messy object diagram then a rough class diagram then I pick a use case and using my pen move around the object diagram being sure I can do that use case (bit like interaction diagram usually that involves jotting down some pseudocode, which like on previous gives me more methods for the class diagram and more things to pseudocode – quit when it gets easy

But design is also about communication What I said on last slide is fine to get started But …. –You may be working with others –You may not be the one who is maintaining the system –You may forget what you did and why So readable design documentation is needed

Worksheet four ??