Вы находитесь на странице: 1из 27

Software Engineering

Lecture 7

Introduction to Unified Modelling Language (UML)


Dr. Ir. Riri Fitri Sari MM MSc 4 October 2010 Faculty of Engineering University of Indonesia

ELH71413

UML - Introduction and Overview


Learning Objective By the end of this lecture you should:

Be able to explain what UML is, where it came from and where its going. Be familiar with each of the Nine UML Diagrams Be familiar with UML packages and stereotypes Appreciate how UML diagrams may be used together to construct multiple views of a system.
Topic 1

Student

Learn about UML

2
This material is based on OOSE, Owen, University of Leeds, 2002.

ELH71413

What is a Diagram?

Definition: Abstract shapes are used to represent things or actions from the real world.
40

Diagrams follow rules and standards The standards make sure that different people will interpret the diagram in the same way
3
Source: OO Analysis and Design with UML, Bennett, McRobb and Farmer, 2002.

ELH71413

Whats the point of Diagrams?


On their own Diagrams provide a convenient abstraction to clarify ones own understanding to show to others for discussion, debate and clarification to provide high level documentation Diagrams are used to communicate information to people. Diagrams should therefore be clear, simple, unambiguous. - i.e. They should follow rules! UML defines a Language, i.e. the rules, for drawing diagrams of computer systems to avoid ambiguity between developers. UML rules include the flexibility to keep diagrams clear and simple by showing only what needs to be shown.
4

ELH71413

Introduction to UML
UML - Unified Modelling Language - Unified

- Modelling
- Language - The UML is a set of different diagram types that can be used alone or together to describe all or part of a system. -Each diagram type can be used to describe a system - from a particular perspective

e.g. classes show a logical view of the system

ELH71413

UML to reduce ambiguity


1) A Visually Rich but ambiguous diagram.
Order

U M Language

Customer requests Item

Salesman agrees sale

Item
Item prepared for shipping

Ship via

Item shipped by Rail

Item Shipped by Road

2) A UML Activity Diagram describing the same flow of events.

Item Received by Customer

ELH71413

Whats the point of Diagrams II?


U M Language

Together We can use a set of diagrams to describe different aspects of a system. at different levels of abstraction to examine specific aspects in detail for different perspectives on the same system to model the views of a system in terms of Requirement Logical Dynamic and 7 Physical views

ELH71413

U M Language UML is Flexible at different levels of abstraction


1) A Valid UML Class
2) An equally valid alternative diagram for the same UML Class.
Ant

Ant

- currentPosition_X: Integer - currentPosition_Y: Integer - direction: Integer - speed: Integer - haveFood: Boolean - knownFoodPosition_X: Integer

- knownFoodPosition_Y: Integer

Key Point Users of UML should work at a level of abstraction appropriate to what they are trying to communicate.

+ newAnt() + drawAnt() + tellFoodLocation() + askFoodLocation() + moveAnt() - goToFood() - search ForFood() - carryFoodToNest()

ELH71413

UML is Flexible Examining specific aspects in detail


Write Chapter Plan Chapter
Author Reviewer Typesetter Printer

U M Language

Produce First Draft Write Chapter

Revise Draft

Review Chapter

[not satisfied] Revise Chapter


[book not complete]

[satisfied]
[book complete]

Add Exercises
Typeset Book

Add References to Bibliography Correct Proofs

Reset Book

Print Book

9 Source: OO Analysis and Design with UML, Bennett, McRobb and Farmer, 2002.

Domain Model: The RUP - Where it came from and where its going.
Software Engineering

ELH71413

Based on a

Development method

The Microsoft Framework

Microsoft

is a member of..

Waterfall development Method

Iterative/ prototyping method

Object oriented method

unified process (UP)

Rational Unified Process (RUP) Unified Modelling Language (UML)


Is managed by

SSADM

RAD

Booch Method Rumbaughs OMT Jacobsons Use Cases

Rational Software Corporation

Key to UML
Is related to Is a type of Organisations are stereotyped with blue class boxes.

bought by...

IBM

is a member of..

International Consortium Object Management Group (OMG) 10

ELH71413

History of UML
1995 Booch Method
Rumbaughs OMT

OOPSLA 10/95 1996

Other Methods

Unified Method 0.8

Jacobsons Use Cases

UML 0.9 UML 1.0

UML patterners input

OMG Submission 1/97

OMG Adoption 11/97


RTF Report 1999 2001 2003

UML 1.1 UML 1.3 UML 1.4 UML 1.5 UML 2.0 11

Major new release 2004?

ELH71413

Unified Modelling Language

Key Points about UML


Its a set of diagrams with notation rules. Diagrams can be used in problem solving. UML is controlled by an independent standards body - the Object Management Group (OMG) - www.omg.org UML is now firmly established as the de facto world standard. UML has it historical roots in OO Systems Development BUT... as a world standard for diagram notation its potentially valuable to any systems development effort any problem solving effort where drawing diagrams helps For an early history of UML read Chris Korbyns paper UML 2001: A Standardization Odyssey (1999)

12 www.omg.org/attachments/pdf/UML_2001_CACM_Oct99_p29-Kobryn.pdf

ELH71413

The Nine UML Diagrams


Use Case Deployment Class

Component Activity State

Object Collaboration Sequence

13

ELH71413
Use Case

Use Case Diagrams


Booking Sales System
Add a Customer Sales Coordinator

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

Update Customer Details

Take a Customer Booking

Sales Manager

Review Sales Performance

Review Staff Performance

These diagrams show the users and what functions the system must provide for them. The functions are described as transactions of value.
14

ELH71413
Use Case

Class Diagrams
Venue

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

Stock Items

Room

Customer Contact

Customer Event Booking

Item required for Booking

Corporate Customer

Internal Customer

Class diagrams present the static (logical) structure of the system. They are the core of the UML notation and of an object-oriented 15 design.

ELH71413
Use Case

Object Diagrams
An Example of an Object Diagram
Bobs Work PC :Computer name = Dell 466 memory = 64
Bob :Author Name = Bob J. Age = 32

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

Bobs Home PC :Computer name = Compaq Pentium MMX memory = 128

Basically the same as a Class diagram but showing single Object Instances and their relationships rather than Classes. Used to describe the Objects in a Scenario.
16

ELH71413
Use Case

Collaboration Diagrams
1. Add Customer()

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

2. Add Contact()

:Customer
3. Confirm Details()

:Customer Contact

Sales Coordinator

Note that these are Object Diagrams with added message arrows to show the messages. These diagrams show the sequence of message sent between collaborating objects for a particular task or scenario. The diagrams highlight the relationships between the collaborating objects.
17

ELH71413
Use Case

Sequence Diagrams
Sales Coordinator

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

:Customer

:Customer Contact

Add Customer() Add Contact()

Confirm Details()

These diagrams show the sequence of message sent between collaborating objects for a particular task or scenario. They highlight the flow of control between the objects.
18

ELH71413

Notation of Interaction Diagrams (Sequence and Collaboration Diagrams)


CASE tools like Rational Rose allow you to generate collaboration diagrams from sequence diagrams (and vice versa). The diagrams show the same information but using different notation.
1. Add Customer() 2. Add Contact()

:Customer
3. Confirm Details()

:Customer Contact

Sales Coordinator Sales Coordinator

:Customer

:Customer Contact

Messages are numbered

Add Customer() Add Contact()

Messages are arranged vertically over tim

Confirm Details()

19

ELH71413
Use Case

State Diagrams
Provisional
[Deposit received] [Cancelled]

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

Confirmed

Cancelled

A Statechart, (or state, or state transition diagram) illustrates the states an object can be in and the transitions which move the object between these states. Guard Conditions using [square brackets] determine which transitions are possible.

Complete

Invoiced

20

ELH71413
Use Case

Activity Diagrams
Check availability

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

These diagrams describe the flow of activities or tasks.


Get a quote Make a Provisional Booking

Pay Deposit

Cancel?

[No]

Attend Event

[Yes]

Pay Balance

They are basically just flow charts! They have - decision points - synchronisation bars The synchronisation bars show activities that can happen in either order or even at the same time.
21

ELH71413

Notation of Transition Diagrams (Activity and State Diagrams)


Start

state
Add a New Client Assign Staff Contact [no campaign to add]

black circle
Decision points

diamond
Guard conditions

[campaign to add]

in square brackets
Final state

Add New Campaign

black circle in white circle

22

ELH71413
Use Case

Component Diagrams
Salesperson Diary & Contacts Customer Database

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

Event Booking User Interface

Events System

Component diagrams illustrate the physical structure of the system in terms of its Software. They show the software components and the dependencies between them.
23

ELH71413
Use Case

Deployment Diagrams

Deployment

Class

Component

Object Collaboration

Activity State

Sequence

:Salespersons PC

:Booking Server

<<LAN>>

Deployment diagrams illustrate the physical architecture of the system in terms of the Hardware it is deployed on and the communication links between hardware nodes.
24

ELH71413

Implementation Diagrams - Component and Deployment Diagrams together


Heres an example where a Deployment Diagram shows the physical deployment of the implementation Components.
It shows how and where the components will be implemented, including the dependencies between components that are physically on different nodes.

:Salespersons PC
Salespers on Diary & Contacts Event Booking User Interface

:Booking Server
Customer Database

<<LAN>>

Events System

25

ELH71413
Package

Packages
A Package is a UML container which can contain one or more similar entities Objects, Classes, Components, Diagrams and other Packages Packages provide a way of organising large scale models

26

ELH71413

Stereotyping
UML includes a feature called stereotypes which enable users to create their own UML symbols. A stereotype can be drawn using guillemets, e.g. << TCP/IP >> OR a Picture can be used instead:
Deployment Diagram: A two PC Network
<< TCP/ IP >>

Key Point - This picture is a valid UML diagram provided that TCP/IP has been declared as a stereotype for a deployment diagram communication association and that the picture of the PC has been declared as a stereotype for a Network PC Deployment node.
27

Вам также может понравиться