Behavioral Modeling with UML

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

Karolina Muszyńska Based on:
A Brief Introduction. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
IEC Substation Configuration Language and Its Impact on the Engineering of Distribution Substation Systems Notes Dr. Alexander Apostolov.
Unified Modeling Language
Object-Oriented Analysis and Design
Improved software quality through semantic descriptions (Skutt) Karlstad University Dept. of Computer Science UML introduction A short introduction.
Using Diagrams to Represent Program Structure OMT and UML Some pictures and material are from “Design Patterns” by Gamma et al.
Systems Analysis & Design Sixth Edition Systems Analysis & Design Sixth Edition Toolkit Part 5.
Kari R. Schougaard, PhD Stud. Værktøjer og Teknikker, 2006 UNIVERSITY OF AARHUS Department of Computer Science Unified Modeling Language Visual language.
CPSC 371/872 UML / SysML Modeling J. YATES MONTEITH, CLEMSON UNIVERSITY, FALL 2014.
Unified Modeling Language
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
Slide 1 UML Review Chapter 2: Introduction to Object-Oriented Systems Analysis and Design with the Unified Modeling Language, Version 2.0 Alan Dennis,
Unified Modeling Language, Version 2.0
January 12, Introduction to Design Patterns Tim Burke References: –Gamma, Erich, et. al. (AKA, The Gang of Four). Design Patterns: Elements of Reusable.
Y2 eProjects Session 4 – Advanced Topics. Objectives  Dynamic Models  Design Patterns (Optional)  Software testing (for S4) ACCP i7.1\Sem3_4\eProject\T4.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Internet and Intranet Protocols and Applications Lecture 5a: HTTP Client-Server Design and Implementation February 15, 2005 Arthur Goldberg Computer Science.
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Object Oriented Analysis and Design 1 CREATED BY RUONAN RAO Object-Oriented Analysis and Design.
Fall 2007 Week 9: UML Overview MSIS 670: Object-Oriented Software Engineering.
Basic Characteristics of Object-Oriented Systems
Unified Modeling Language. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems,
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Object Oriented Systems Design
Presented by FACADE PATTERN
Introduction to UML.
UML Diagrams By Daniel Damaris Novarianto S..
Sachin Malhotra Saurabh Choudhary
Evolution of UML.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Software Design.
Systems Analysis and Design With UML 2
Design Patterns Introduction
Chapter 11: Collaboration Diagram - PART1
Unified Modeling Language
Software Requirements
Systems Analysis and Design With UML 2
James Miller, Julia John
University of Central Florida COP 3330 Object Oriented Programming
UML Diagrams Jung Woo.
A short introduction to UML Eivind J. Nordby Karlstad University
Object-Oriented Analysis
Systems Analysis and Design With UML 2
Introduction to UML.
Introduction to the Unified Modeling Language
Chapter 20 Object-Oriented Analysis and Design
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Software Construction Lecture 2
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
Using Diagrams to Represent Program Structure
Software Requirements
Domain Modeling.
Domain Modeling.
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Databases and the MVC Model
Appendix A Object-Oriented Analysis and Design
Software Requirements
Presentation transcript:

Behavioral Modeling with UML https://flic.kr/p/7xu9QE Behavioral Modeling with UML

SWEBOK Knowledge Areas Software Requirements Software Design Software Construction Software Testing Software Maintenance Software Configuration Management Software Engineering Management Software Engineering Process Software Engineering Models and Methods Software Quality Software Engineering Professional Practice Software Engineering Economics Computing Foundations Mathematical Foundations Engineering Foundations Today’s topic

Overview Structural modeling Behavioral modeling Brief intro to design patterns

What does a class diagram represent? User name : string email : string buyer 1 seller 1 Has Has purchase sale * * Sale price : integer description : string

What does a class diagram represent? User name : string email : string Set of possible objects Instances of each class Set of possible configurations Attribute values Links between objects buyer 1 seller 1 Has Has purchase sale * * Sale price : integer description : string

Pros/cons of class diagram User name : string email : string Pro: Abstract/General Represents all possible objects/configurations Con: Complex A lot of possibilities to consider buyer 1 seller 1 Has Has Sometimes easier to reason about objects (more concrete) than about classes (more abstract) purchase sale * * Sale price : integer description : string

Object Diagrams Class Diagram Object Diagram Sale price : integer description : string surface sale : Sale price = 500 description = "Microsoft Surface" ipad sale : Sale price = 600 description = "Apple iPad" galaxy sale : Sale price = 250 description = "Samsung Galaxy"

Object Diagram Notation name Colon separator type Attribute value galaxy sale : Sale price = 250 description = "Samsung Galaxy" Underline denotes object (as opposed to class) Object Corresponding class: Sale price : integer description : string

Object diagram is snapshot of system at point in time Object Diagrams Class Diagram Object Diagram Sale price : integer description : string surface sale : Sale price = 500 description = "Microsoft Surface" ipad sale : Sale price = 600 description = "Apple iPad" Object diagram is snapshot of system at point in time galaxy sale : Sale price = 250 description = "Samsung Galaxy"

What about associations? Class Diagram Object Diagram User name : string email : string buyer 1 seller 1 ipad sale : Sale price = 600 description = "Apple iPad" Has Has purchase sale * * Sale price : integer description : string

First, let’s add users Class Diagram Object Diagram User name : string email : string alice : User name = "Alice" email = "alice@memphis.edu" buyer 1 seller 1 ipad sale : Sale price = 600 description = "Apple iPad" Has Has purchase sale * * Sale price : integer description : string bob : User name = "Bob" email = "bob@memphis.edu"

Now, make Alice a seller Class Diagram Object Diagram Add a link User name : string email : string alice : User name = "Alice" email = "alice@memphis.edu" Has seller sale Add a link buyer 1 seller 1 ipad sale : Sale price = 600 description = "Apple iPad" Has Has purchase sale * * Sale price : integer description : string bob : User name = "Bob" email = "bob@memphis.edu"

No multiplicities on links Now, make Alice a seller Class Diagram Object Diagram User name : string email : string alice : User name = "Alice" email = "alice@memphis.edu" No multiplicities on links seller buyer 1 seller 1 Has sale ipad sale : Sale price = 600 description = "Apple iPad" Has Has purchase sale * * Sale price : integer description : string bob : User name = "Bob" email = "bob@memphis.edu"

Lastly, make Bob the buyer Class Diagram Object Diagram User name : string email : string alice : User name = "Alice" email = "alice@memphis.edu" seller buyer 1 seller 1 Has sale ipad sale : Sale price = 600 description = "Apple iPad" Has Has Has buyer purchase purchase sale * * Sale price : integer description : string bob : User name = "Bob" email = "bob@memphis.edu"

Is this valid? alice : User name = "Alice" email = "alice@memphis.edu" seller buyer User name : string email : string Has purchase Has ipad sale : Sale price = 600 description = "Apple iPad" buyer 1 seller 1 sale sale Has Has surface sale : Sale price = 500 description = "Microsoft Surface" Has purchase sale * * purchase Sale price : integer description : string Has buyer seller bob : User name = "Bob" email = "bob@memphis.edu"

Is this valid? Yes! alice : User name = "Alice" email = "alice@memphis.edu" Yes! seller buyer User name : string email : string Has purchase Has ipad sale : Sale price = 600 description = "Apple iPad" buyer 1 seller 1 sale sale Has Has surface sale : Sale price = 500 description = "Microsoft Surface" Has purchase sale * * purchase Sale price : integer description : string Has buyer seller bob : User name = "Bob" email = "bob@memphis.edu"

How ’bout this? alice : User name = "Alice" email = "alice@memphis.edu" buyer User name : string email : string Has purchase ipad sale : Sale price = 600 description = "Apple iPad" seller sale chuck : User name = "Chuck" email = "chuck@memphis.edu" Has buyer 1 seller 1 sale Has Has Has purchase sale * * Sale price : integer description : string seller bob : User name = "Bob" email = "bob@memphis.edu"

How ’bout this? No! 1 seller per sale! alice : User name = "Alice" email = "alice@memphis.edu" No! 1 seller per sale! buyer User name : string email : string Has purchase ipad sale : Sale price = 600 description = "Apple iPad" seller sale chuck : User name = "Chuck" email = "chuck@memphis.edu" Has buyer 1 seller 1 sale Has Has Has purchase sale * * Sale price : integer description : string seller bob : User name = "Bob" email = "bob@memphis.edu"

Note: No inheritance in object diagrams User name : string email : string zed : User name = "Zed" email = "zed@memphis.edu" wolverine : Spy name = "Logan" email = "logan@mutant.edu" alias = "Wolverine" Spy alias : string

Class and object diagrams model structure What the objects are How they’re connected What attributes/operations they have But structure isn’t everything What else might you want to model?

Behavioral Modeling How objects interact Two notations: What messages are exchanged over links Messages = method calls/returns Message protocols Scenarios of interaction Two notations: Communication diagram Sequence diagram

Communication Diagram From The Unified Modeling Language Reference Manual, Second Edition by Rumbaugh et al.

Communication Diagram From The Unified Modeling Language Reference Manual, Second Edition by Rumbaugh et al.

Communication Diagram Binds to link Binds to object

Communication Diagram

Communication Diagram

Communication Diagram

Communication Diagram

Sequence Diagram From The Unified Modeling Language Reference Manual, Second Edition by Rumbaugh et al.

Sequence Diagram From The Unified Modeling Language Reference Manual, Second Edition by Rumbaugh et al.

Sequence Diagram

Sequence Diagram

Sequence Diagram

Sequence Diagram

Sequence Diagram

Sequence Diagram

Sequence Diagram

Sequence Diagram

Communication and sequence diagrams both represent scenario Why prefer one over other?

Communication and sequence diagrams both represent scenario Why prefer one over other? Communication includes structure Sequence easier to read message exchange

So what are all these notations good for? Reasoning about your own designs Understanding other people’s designs And design patterns!

Required reading for software designers “Gang of Four” (GoF) book 23 patterns Template solutions to common problems

Common Problem: Many objects interconnected in complex ways From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Common Problem: Many objects interconnected in complex ways ?

Mediator Pattern From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Mediator Pattern From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Application of Mediator Pattern From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Application of Mediator Pattern From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Application of Mediator Pattern From Design Patterns: Elements of Reusable Object-Oriented Software (Gamma et al., 1995)

Summary Structural modeling with Behavioral modeling with Class diagrams Object diagrams Behavioral modeling with Communication diagrams Sequence diagrams