smith’s aerospace © p. bailey & k. vander linden, 2006 the unified modeling language patrick...
TRANSCRIPT
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006
The Unified Modeling Language
Patrick BaileyKeith Vander LindenCalvin College
3
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
The Unified Modeling Language● UML is a visual language for
specifying, constructing and documenting the artifacts of systems.
● Characteristics:– A collection of diagramming languages– Non-proprietary– Semi-formal– Object-oriented– Process-neutral
4
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Outline● Modeling● History● Diagrams● Example● Using UML
5
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Modeling: Architecture
Images from Calvin College, August, 2005
Models are a representations of certain aspects of the world.
6
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
System
Modeling: Systems
database
Post Book
Seller
Update Profile
Request Price Comparison
Remove Book
Buyer
Request a Watch
Login
<<include>>
<<include>>
<<include>>
Request Book
<<include>>
Search for Books
<<include>>
<<include>> <<include>>
<<include>>
Book CD/DVD
Course SectionIDnameprofessor
getItems()requestHold()
ItemtitlecreatoraskingPrice
setCourse()requestItem()findRequests()
DataBase
backup()findUser()findItem()findCourse()removeItem()
<<persistent>>
UserloginNamepasswordemailAddressphoneNumberfullName
getItems()removeItem()sendEmailTo()checkPassword()removeRequest()
0..n 0..n0..n0..n 0..n 10..n 1
DBBuyer DBSeller
Mary : Seller login : Login Page
bc : DataBase
Mary : DBSeller
s : Search Page
r : Remove Page
UML Distilled : Book
John : DBBuyer
1: login( )
2: findUser( )
3: checkPassword( )
4: start( )
5: findItem( )6: start( )
7: findRequests( )
8: sendEmailTo( )9: removeItem( )
Models are a representations of certain aspects of the world.
7
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Modeling and Reality● Blueprints aren’t buildings. ● Models aren’t systems.
Image from www.wikipedia.org, August, 2005
Book CD/DVD
Course SectionIDnameprofessor
getItems()requestHold()
ItemtitlecreatoraskingPrice
setCourse()requestItem()findRequests()
DataBase
backup()findUser()findItem()findCourse()removeItem()
<<persistent>>
UserloginNamepasswordemailAddressphoneNumberfullName
getItems()removeItem()sendEmailTo()checkPassword()removeRequest()
0..n 0..n0..n0..n 0..n 10..n 1
DBBuyer DBSeller
Ceci n’est pas une système
8
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
● Each amigo (and dozens of others) had created their own modeling languages / processes in the 1980’s.
● They joined forces at Rational in the mid-90’s to create a “Unified” Modeling Language.
The Three Amigos UML
Images from www.rational.com, January, 2003
GradyBooch
James Rumbaugh
Ivar Jacobson
9
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
● The OMG, a non-profit consortium of companies, produces and maintains standards.
● UML Standards:– UML 2.0 Superstructure, 2004
● UML Profiles– Real-time profile, 2005
Images from www.omg.org, August, 2005
OMG UML Standards
10
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
UML Tools
There are many tools that support UML:– IBM Rational Rose– iLogix Rhapsody– Microsoft Visio– Sparx Enterprise Architect– …
11
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Diagramming Languages● UML Diagramming languages
provide various views on a single meta-model.
● These views are loosely organized into the following types of diagrams:– Structural
– Behavioral
● UML 2.0 includes 13 languages.
12
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
UML 2.0 DiagramsDiagram«abstract»
Structure«abstract»
Behavior«abstract»
Class
Object
Package
Component
Deployment
CompositeStructure
UseCase
Interaction«abstract»
StateMachine
Activity
SequenceCommunication Timing
InteractionOverview
13
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Example: Use-Case Diagram
Dishwasher
WashDishes
ServiceDishwasher
CleansingEngineerCleansingEngineer
ServiceEngineerServiceEngineer
Example from www.ilogix.com, August, 2005
14
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Example: Class Diagram
Example from www.ilogix.com, August, 2005
Display«entrypoint»
Dishwasher«Singleton»
rinseTime:IntegerwashTime:IntegerdryTime:Integercycles:Integer
isDried():BooleanisWashed():BooleanisRinsed():Booleansetup():voiddec_rinse_time():void
«Usage»
15
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Example: State Diagram
Off
Open
Running
Washing
op_tick/dec_wash_time;
Rinsing
[isWashed]
op_tick/dec_rinse_time; Drying
[isRinsed]
op_tick/dec_dry_time;
op_close
op_open
op_start/setup;
op_tick/dec_wash_time;
[isWashed]
op_tick/dec_rinse_time;
[isRinsed]
[isDried]
op_tick/dec_dry_time;
Done
Done
Example from www.ilogix.com, August, 2005
16
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Example: Compilation
Example from www.ilogix.com, August, 2005
17
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Example: Execution
Example from www.ilogix.com, August, 2005
18
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Using UMLLanguage = syntax + semantics +
pragmatics
● 20% of UML is used 80% of the time.
● UML can model garbage or gold with equal ease.
19
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Using UML: Why?● Conceptual modeling
● Software modeling
20
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Using UML: How?● Sketch
● Blueprint
● Programming language
21
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
Using UML: Directionality● Forward engineering
● Reverse engineering
● Round-trip
22
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005
UML and Software Process● UML fits naturally into traditional
software development processes.
● UML is also compatible with agile development processes:– Model to support
discovery/communication.– Don’t model all of the system.– Prefer simple tools.