MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

Similar documents
Chapter 2, lecture 2 Modeling with UML

Chapter 2, Modeling with UML, Part 2

Chapter 2, Modeling with UML, Part 2

Chapter 2, Modeling with UML

Chapter 2, Modeling with UML, Part 2

Chapter 2, Modeling with UML, Part 2

Course "Softwaretechnik Modeling with UML Stephan Salinger

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Chapter 2, Modeling with UML

Chapter 2, Modeling with UML

Software Engineering

Overview of the OOA Process...

2. Modeling with UML

Recap : UML artefacts. Black Box Requirements. Functional Specification. System. System. Test. Design. System. System. Development.

Design Patterns. Design Patterns

Chapter 2, lecture 1, Modeling with UML

CSE 308. UML Overview Use Case Diagrams. Reference. en.wikipedia.org/wiki/class_diagram. Robert Kelly, B. Bruegge,

Chapter 5, Analysis: Dynamic Modeling

Object Relationships UML Class diagrams. Software Requirements and Design CITS 4401 Lecture 4

CSE 308. UML Overview Use Case Diagrams. Reference. Class diagrams. Session 6 UML Intro/Use cases. Robert Kelly, B. Bruegge,

Software Service Engineering

Modern methods in Software Engineering UML.

A Rapid Overview of UML

Software Development Methodologies

Unified Modeling Language (UML)

Introduction to Software Engineering. 5. Modeling Objects and Classes

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

UML Primer. -Elango Sundaram

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Meltem Özturan

Lecture 16+17: Modeling with UML

Lecture 15: Modeling with UML

CISC 322 Software Architecture

Unified Modeling Language

Engineering Design w/embedded Systems

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 09/29/2015

Object Oriented Modeling

Course 3 7 March

Introduction to Software Engineering. 5. Modeling Objects and Classes

How and Why to Use the Unified Modeling Language. among software components, architectural-based

Unified Modeling Language (UML)

From Analysis to Design. LTOOD/OOAD Verified Software Systems

Chapter 4 Requirements Elicitation

Introduction to Software Engineering. 6. Modeling Behaviour

3.0 Object-Oriented Modeling Using UML

UML: Unified Modeling Language

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

The Unified Modeling Language (UML)

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Lecture 33 April 4, Unied Modelling Language. ECE155: Engineering Design with Embedded Systems Winter Patrick Lam version 1

Interaction Modelling: Sequence Diagrams

LESSON PLAN SUB NAME : OBJECT ORIENTED ANALYSIS AND DESIGN UNIT SYLLABUS

UML (Unified Modeling Language)

CS 451 Software Engineering

Lecture #2 on Object-Oriented Modeling

Index. : (colon), 80 <<>> (guillemets), 34, 56

UNIT-4 Behavioral Diagrams

Unified Modeling Language (UML)

Object-Oriented Analysis Techniques Coad s OOA Technique Short History Terminological Comparison Postscript and Remarks

Introduction for using UML

Modeling Requirements

UNIT-I Introduction of Object Oriented Modeling

Overview of the OOA Process...

Software Development. Modular Design and Algorithm Analysis

INTRODUCTION TO UNIFIED MODELING MODEL (UML) & DFD. Slides by: Shree Jaswal

CS 370 REVIEW: UML Diagrams D R. M I C H A E L J. R E A L E F A L L

MechEng SE3 Lecture 7 Domain Modelling

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

Object-Oriented Design

Chapter 5, Analysis: Dynamic Modeling

Agenda. Why Model. Why Model? History of OO Modeling Methodologies Object Modeling Technique (OMT) Unified Modeling Language (UML)

The Unified Modeling Language User Guide

administrivia today UML start design patterns Tuesday, September 28, 2010

Object-oriented development. Object-oriented Design. Objectives. Characteristics of OOD. Interacting objects. Topics covered

Chapter 5, Analysis: Dynamic Modeling

2 UML for OOAD. 2.1 What is UML? 2.2 Classes in UML 2.3 Relations in UML 2.4 Static and Dynamic Design with UML. UML for OOAD Stefan Kluth 1

Interactions A link message

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

Software Engineering Fall 2014

1 Introduction. 1.1 Introduction

Software Engineering (CSC 4350/6350) Rao Casturi

OO Analysis and Design with UML 2 and UP

VISHNU INSTITUTE OF TECHNOLOGY Vishnupur, BHIMAVARAM

Object-Oriented and Classical Software Engineering

Advanced Interaction

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Object Oriented Software Engineering Ivar Jacobson

UML Diagrams & And Some Of Their Elements

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Object-Oriented Software Engineering Practical Software Development using UML and Java

Domain Engineering And Variability In The Reuse-Driven Software Engineering Business.

Software Engineering Lab Manual

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Transcription:

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML Some of this material is based on Bernd Bruegge and Allen H. Dutoit (2009) Object-Oriented Software Engineering: Using UML, Patterns, and Java, Pearson, 3 rd edition.

Overview: modelling with UML What is modelling? What is UML? Use case diagrams Class diagrams Sequence diagrams Activity diagrams

What is modelling? Modelling consists of building an abstraction of reality. Abstractions are simplifications because: w They ignore irrelevant details and w They only represent the relevant details. What is relevant or irrelevant depends on the purpose of the model.

Example: street map

Why model software? Software is getting increasingly more complex: w Samples of complex software. w A single programmer cannot manage this amount of code in its entirety. Code is not easily understandable by developers who did not write it. We need simpler representations for complex systems: w Modelling is a means for dealing with complexity.

What should be done first? Coding or Modelling? It all depends. Forward Engineering w Creation of code from a model w Start with modelling w Greenfield projects Reverse Engineering w Creation of a model from existing code w Interface or reengineering projects Roundtrip Engineering w Move constantly between forward and reverse engineering w Reengineering projects w Useful when requirements, technology and schedule are changing frequently.

What is UML? Unified Modelling Language Convergence of different notations used in objectoriented methods, mainly t OMT (James Rumbaugh and colleagues), OOSE (Ivar Jacobson), Booch (Grady Booch) They also developed the Rational Unified Process, which became the Unified Process in 1999

Origins OO programming languages OO analysis and design techniques w business modelling w analysis of requirements w design of software systems UML: industry standard that merges the best features of different notations

What UML is not UML is not a programming language per se UML is not a software modelling tool UML is not a method, methodology or software development process

Why UML? De facto standard for OO modelling Unified modelling language UML provides extension mechanisms

UML overview Use case diagrams w Describe the functional behaviour of the system as seen by the user. Class diagrams w Describe the static structure of the system: objects, attributes, associations. Sequence diagrams w Describe the dynamic behaviour between objects of the system. Activity diagrams w Describe the dynamic behaviour of a system, in particular the workflow.

USE CASE DIAGRAM

UML Use Case Diagrams Used during requirements elicitation and analysis to represent external behaviour ( visible from the outside of the system ) Passenger PurchaseTicket An Actor represents a role, that is, a type of user of the system A use case represents a class of functionality provided by the system Use case model: The set of all use cases that completely describe the functionality of the system.

Actors Passenger Name An actor is a model for an external entity which interacts (communicates) with the system: w User w External system (Another system) w Physical environment (e.g. Weather) An actor has a unique name and an optional description Examples: w Passenger: A person in the train Optional Description w GPS satellite: An external system that provides the system with GPS coordinates.

Use Case PurchaseTicket A use case represents a class of functionality provided by the system Use cases can be described textually, with a focus on the event flow between actor and system The textual use case description consists of 6 parts: 1. Unique name 2. Participating actors 3. Entry conditions 4. Exit conditions 5. Flow of events 6. Special requirements.

Textual Use Case Description Example Passenger PurchaseTicket 1. Name: Purchase ticket 2. Participating actor: Passenger 3. Entry condition: Passenger stands in front of ticket distributor Passenger has sufficient money to purchase ticket 5. Flow of events: 1. Passenger selects the number of zones to be traveled 2. Distributor displays the amount due 3. Passenger inserts money, at least the amount due 4. Ticket Distributor returns change 5. Ticket Distributor issues ticket 6. Special requirements: None. 4. Exit condition: Passenger has ticket

Use Case Models should be packaged Use Case Actor. System boundary

CLASS DIAGRAM

Class Diagrams Class diagrams represent the structure of the system Used w during requirements analysis to model application domain concepts w during system design to model subsystems w during object design to specify the detailed behaviour and attributes of classes. TarifSchedule zone2price: Table getzones():enumeration getprice(zone):price * * Trip zone:zone Price: Price

Classes Type TarifSchedule zone2price getzones() getprice() Name Attributes Operations TarifSchedule zone2price: Table getzones(): Enumeration getprice(zone):price Signature TarifSchedule A class represents a concept A class encapsulates state (attributes) and behaviour (operations) Each attribute has a type Each operation has a signature The class name is the only mandatory information

Instances tarif2006:tarifschedule zone2price = { { 1, 0.20}, { 2, 0.40}, { 3, 0.60}} :TarifSchedule zone2price = { { 1, 0.20}, { 2, 0.40}, { 3, 0.60}} An instance represents a phenomenon The attributes are represented with their values The name of an instance is underlined The name can contain only the class name of the instance (anonymous instance)

Actor vs Class vs Object Actor w An entity outside the system to be modelled, interacting with the system ( Passenger ) Class w An abstraction modelling an entity in the application or solution domain w The class is part of the system model ( User, Ticket distributor, Server ) Object w A specific instance of a class ( Joe, the passenger who is purchasing a ticket from the ticket distributor ).

Associations TarifSchedule getzones():enumeration getprice(zone):price * * TripLeg Price Zone Associations denote collaborations between classes by means of message exchange. The multiplicity of an association end denotes how many objects the instance of a class can legitimately reference.

Association properties Name Multiplicity: number of object instances of the class at the far end of an association for one instance of the class at the near end of an association Role names w role played by a class in an association w useful to specify methods

Aggregation An aggregation is a special case of association denoting that one class may consist of, or include, instances of another class. A solid diamond denotes composition: the lifetime of the component instances is controlled by the aggregate.

Inheritance Button CancelButton ZoneButton Inheritance is another special case of an association denoting a kind-of hierarchy Inheritance simplifies the analysis model by introducing a taxonomy The children classes inherit the attributes and operations of the parent class.

SEQUENCE DIAGRAM

Sequence Diagrams Focus on control flow Passenger selectzone() insertcoins() pickupchange() pickupticket() TicketMachine Used during analysis w To refine use case descriptions w to find additional objects ( participating objects ) Used during system design TicketMachine w to refine subsystem interfaces zone2price Instances are represented Messages by -> selectzone() rectangles. Actors by sticky Operations figureson insertcoins() participating Object Lifelines are represented by dashed pickupchange() lines pickupticket() Messages are represented by arrows Activations are represented by narrow rectangles.

Sequence Diagrams can also model the Flow of Data Passenger ZoneButton TarifSchedule Display selectzone() lookupprice(selection) price Dataflow displayprice(price) continued on next slide... The source of an arrow indicates the activation which sent the message Horizontal dashed arrows indicate data flow, for example return results from a message

Sequence Diagrams: Iteration & Condition continued from previous slide... ChangeProcessor CoinIdentifier Display CoinDrop Passenger * insertchange(coin) lookupcoin(coin) Iteration price displayprice(owedamount) Condition [owedamount<0] returnchange(-owedamount) continued on next slide... Iteration is denoted by a * preceding the message name Condition is denoted by boolean expression in [ ] before the message name

Sequence Diagram Properties UML sequence diagram represent behaviour in terms of interactions Useful to identify or find missing objects Time consuming to build, but worth the investment Complement class diagrams (which represent structure).

ACTIVITY DIAGRAM

Activity Diagrams An activity diagram is a special case of a state chart diagram The states are activities ( functions ) An activity diagram is useful to depict the workflow in a system Handle Incident Document Incident Archive Incident

Activity Diagrams allow to model Decisions Decision Open Incident [lowpriority] [fire & highpriority] Allocate Resources [not fire & highpriority] Notify Fire Chief Notify Police Chief

Activity Diagrams can model Concurrency Synchronization of multiple activities Splitting the flow of control into multiple threads Splitting Allocate Resources Synchronization Open Incident Coordinate Resources Archive Incident Document Incident

Activity Diagrams: Grouping of Activities Activities may be grouped into swimlanes to denote the object or subsystem that implements the activities. Allocate Resources Dispatcher Open Incident Coordinate Resources Archive Incident Document Incident FieldOfficer

UML Summary UML provides a wide variety of notations for representing many aspects of software development w Powerful, but complex UML is not a programming language w Can be misused to generate unreadable models w Can be misunderstood when using too many exotic features We concentrated on a few notations: w Functional model: Use case diagram w Object model: class diagram w Dynamic model: sequence diagrams and activity diagrams

Additional References Martin Fowler w UML Distilled: A Brief Guide to the Standard Object Modelling Language, 3rd ed., Addison-Wesley, 2003 Grady Booch, James Rumbaugh, Ivar Jacobson w The Unified Modelling Language User Guide, Addison Wesley, 2 nd edition, 2005 Open Source UML tools (https://en.wikipedia.org/wiki/list_of_unified_modeling_lang uage_tools) w Eclipse Papyrus (built atop the Eclipse Modeling Framework) t https://www.eclipse.org/papyrus/ w PlantUML (textual UML using DSLs) t http://plantuml.com/