UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION UNIFIED MODELING LANGUAGE (UML) Autumn 2011
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
© Copyright Eliyahu Brutman Programming Techniques Course.
UML a crash course Alex Lo Brian Kiefer. Overview Classes Class Relationships Interfaces Objects States Worksheet.
SE-565 Software System Requirements More UML Diagrams.
1 CSE 403 Design and UML Class Diagrams Reading: UML Distilled Ch. 3, by M. Fowler These lecture slides are copyright (C) Marty Stepp, They may not.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
UML January 24, 2011 CSE 403, Winter 2011, Brun Design and UML Class Diagrams.
Unified Modeling Language
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
UML Sequence Diagrams Reading: UML Distilled Ch. 4, by M. Fowler
Sequence Diagram Tutorial
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
UML S EQUENCE D IAGRAMS 1 Dr. Hoang Huu Hanh, OST – Hue University hanh-at-hueuni.edu.vn.
System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
UML January 26, 2011 CSE 403, Winter 2011, Brun UML Sequence Diagrams.
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
1 UML Sequence Diagrams UML Distilled, Third Edition, Chapter 4 M. Fowler.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
An Introduction to the Unified Modeling Language
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Design Jon Walker. More UML ● What is UML again?
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
INFSY 535.  Small systems  Larger systems 1.Understand the program requirement- what 3. Write and test each part (unit testing) 4. Maintenance 2. Specify.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Chapter 3: Introducing the UML
CSE 403 Lecture 8 UML Sequence Diagrams Reading: UML Distilled, Ch. 4, M. Fowler slides created by Marty Stepp
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Unified Modeling Language (UML)
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
COP 3330 Notes 4/13. Today’s Topics UML Class Diagrams.
Design and UML Class Diagrams
Appendix 3 Object-Oriented Analysis and Design
TCSS 305 (Stepp) OO Design with UML Class Diagrams
Sequence Diagram.
Unified Modeling Language
Object-Oriented Analysis and Design
Unified Modeling Language—UML A Very Brief Introduction
UML SEQUENCE DIAGRAM.
Unified Modeling Language
UML UML Sequence Diagrams CSE 403
Introduction to Unified Modeling Language (UML)
Lecture on Design Phase and UML Class Diagrams
Prepared By Sidra Noureen
UML Diagrams: The Static Model Class Diagrams
Superior University, Lahore
CIS 375 Bruce R. Maxim UM-Dearborn
Unified Modelling Language
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Introduction to UML Sources:
CIS 375 Bruce R. Maxim UM-Dearborn
Presentation transcript:

UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov

Design Phase design: Specifying the structure of how a software system will be written and function (without actually writing the code). a transition from "what" the system must do, to "how" the system will do it –What classes will we need in order to implement a system that meets our requirements? –What fields and methods will each class have? –How will the classes interact with each other?

Introduction to UML Unified Modeling Language (UML): depicts an OO system –programming languages are not abstract enough for OO design –UML is an open standard; lots of companies use it many programmers either know UML or a "UML-like" variant

UML Class Diagrams UML class diagram: A picture of the classes in an OO system, their fields and methods, and connections between the classes that interact or inherit from each other What are some things not represented in a class diagram? –details of how the classes interact –algorithmic details; how particular behavior is implemented –trivial methods ( get / set ) –classes that come from libraries ( ArrayList, etc.)

Diagram of a class class name in top of box –write > on top of interface’s names –use italics for an abstract class name attributes –include all fields of the object –include properties “derived” properties operations (constructors/methods) –may omit trivial methods – get/set except from an interface –should not include inherited methods

Class attributes syntax: –visibility name : type [count] = defaultValue underline static attributes SymbolVisibility +public #protected -private ~package (default) /derived

Class operations/methods syntax: –visibility name(parameters): returnType underline static methods parameter types listed as (name: type) omit returnType on constructors and when return is void

Relationships between classes generalization: an inheritance relationship –inheritance between classes –interface implementation association: a usage relationship –dependency –aggregation –composition

Generalization hierarchies are drawn top down –arrow from child to parent trivial/obvious relationships often not drawn –Java: Object ParentLine/Arrow Style classsolid, black arrow abstract classsolid, white arrow interfacedashed, white arrow

Association 1.multiplicity 2.name –what relationship the objects have 3.navigability –direction SymbolHow many are used? *0, 1, or more 1exactly between 2 and 4 5..*5 or more

Association types aggregation: “is part of” –clear, white diamond composition: “is entirely made of” –stronger version of aggregation –the parts only exist while the whole exists –black diamond dependency: “uses temporarily” –dotted arrow or line 1 1 aggregation Car Engine Page Book composition * 1 Lottery Ticket Random dependency

UML Sequence Diagrams sequence diagram: an “interaction diagram” that models a single scenario executing in the system UML representation of a use case

Sequence diagram key parts participant: object or entity that acts in the diagram message: communication between participants axes in a sequence diagrams –horizontal: which participant/object is acting –vertical: time (down = forward in time)

Representing objects Rectangles with object type, optionally preceded by “name : ” –Write object’s name if it clarifies the diagram –Object’s “life line” represented by dashed vertical line

Messages between objects messages (methods calls) represented by arrow to other object –method name and arguments written above the arrow

Messages continued messages (methods calls) represented by arrow to other object –dashed arrow back indicates return –different arrows for normal and concurrent/asynchronous calls

Object lifetime creation: arrow with “new” written above it –object created after start of scenario appears lower than the others deletion: an X at bottom of object’s lifeline –more applicable to languages with manual memory management (C, C++)

Method activiation 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

If statements 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]

Linking sequence diagrams If one diagram is too large or refers to another, indicate with: –a "ref" frame that names the other diagram –Or an unfinished arrow and comment,

Violet Tool for creating UML diagrams Free Easy to learn/use Other software: –Rational Rose –Visual Paradigm UML Suite –Microsoft Visio