3. www.spiraltrain.nl
What is UML?
• Unified Modeling Language for modeling systems :
• Mechanical systems, Electronic systems, Software systems
• Or a combination
• But also business processes
• A language that helps to cope with complexity of systems :
• Abstracts from uninteresting details
• Provides different, but related views
• Reveals large scale structure (architecture)
• A language that helps to develop software systems :
• Modeling the problem domain
• Specifying desired system behavior
• Describe implementation
• UML is not :
• A software development process like RUP or Scrum
• A programming language (models are not executable)
• A rigid prescription for modeling
UML Introduction 3
4. www.spiraltrain.nl
Modeling Reasons
• Provide structure for problem solving
• Improve communication with stakeholders
• Clarify requirements
• Experiment to explore multiple solutions
• Furnish abstractions to manage complexity
• Reduce time-to-market for business problem solutions
• Decrease development costs
• Manage the risk of mistakes
• Visual Modeling because graphics reveal data
• One picture can say more then thousands words
• 1 bitmap = 1 megaword
UML Introduction 4
5. www.spiraltrain.nl
UML History
• Number of OO methods increased to more than 50 in 1994
• The most notable and popular methods were :
• Booch's OOD , Jacobson's OOSE, Rumbaugh's OMT
• Fusion, Shlaer-Mellor, Coad and Yourdon
• No modeling language filled all needs completely
• This led to a Babylonian language confusion :
• Everybody invents and speaks his own modeling language
• Everybody has a different understanding of modeling concepts
• Tools all used a different language or dialect
• Interchange of models is not possible
• Around 1994 a comedy acted out in real life : The Three Amigos :
• Booch convinced methodologists Jacobson, Rumbaugh to join him at Rational
• This led to the birth of UML which incorporated the best of each OO method
• In 1997 first version of UML was released :
• It has been adopted by the OMG and is an ISO standard
UML Introduction 5
6. www.spiraltrain.nl
UML Versions
• Current version UML 2.5 was released in June 2015 :
• Added where XMI, XML Model Interchange, and OCL, Object Constraint Language
UML Introduction 6
7. www.spiraltrain.nl
Object Management Group (OMG)
• International industrial consortium with over 800 members :
• Member-controlled not-for-profit
• OMG wants to provide a framework for software development :
• Stimulate growth of object technology e.g. CORBA
• Increase interoperability of software of different vendors
• Reducing confusion by setting standards
• OMG’s mission since 1989 is to develop an architecture :
• For modeling and distributed application integration
• Guaranteeing reusability of components, interoperability and portability
• OMG Task Forces develop enterprise integration :
• Real-time, Embedded and Specialized Systems
• Analysis and Design, Architecture-Driven Modernization and Middleware
• OMG organizes for Internationalization and Unicode Conferences
UML Introduction 7
8. www.spiraltrain.nl
OMG Modeling and Metadata Specifications
• Specifications freely available and implementations exist :
• Includes several open modeling standards
• UML (Unified Modeling Language) :
• UML is a specification defining a graphical language
• Used for specifying, constructing artifacts of distributed object systems
• XMI (XML Metadata Interchange) :
• XMI is a model driven XML Integration framework for XML data and objects
• Rules by which a schema can be generated for a MOF-based metamodel
• OCL (Object Constraint Language) :
• Declarative language describing rules applying to UML models
• Precise text language providing constraint and object query expressions
• MOF (Meta-Object Facility) :
• MOF is a standard for model driven engineering
• Provides a type system for entities and interfaces to create and manipulate them
UML Introduction 8
9. www.spiraltrain.nl
UML Diagrams
• UML is constructed specifically to enable modeling of objects :
• Their structure, behavior and interaction
• Use Case Diagrams :
• Display boundary of system its major modes of use as observed by external actors
• Class Diagrams :
• Model the structure of objects
• Interaction Diagrams :
• In particular sequence diagrams and collaboration diagrams
• Show how particular use cases are realized through interactions between objects
• Statechart Diagrams :
• Model individual object behavior
• Component and Deployment Diagrams :
• Describe the physical implementation architecture
UML Introduction 9
11. www.spiraltrain.nl
UML Diagram Characteristics
• UML offers a diagrammatic language-syntax :
• Models must satisfy the syntactic rules
• Language may be extended with new syntactic notions :
• Must be expressed in the existing ones
• New icons may be introduced using stereotypes
• Diagrams of model describe aspects (or views) of same system :
• Models must be consistent
• At any stage of modeling :
• Selected details may be added or omitted from the diagrams
• Models may be incomplete
• Models may be adorned with more information
UML Introduction 11
12. www.spiraltrain.nl
UML Views
• Use Case View :
• Captures mode of use of system as observed by external actor
• Use Case diagram is visual representation of such modes of use
• Logical View :
• Captures static and dynamic relationships between conceptual entities in a domain
• Logical View abstracts from their physical representation or implementation
• Class diagrams and object diagrams are used in the logical view
• Component View :
• Captures system’s physical packaging, such as program files and subsystems
• Component diagram is visual representation of components
• Process View :
• Captures dynamic behavior of a system
• State, activity, sequence and collaboration diagrams are used in the process view
• Deployment View :
• Description of the allocation of components to execution resources
• Deployment diagram identifies deployment modules
UML Introduction 12
14. www.spiraltrain.nl
Use-Case View
• Use-Case Diagrams model modes of use of a system :
• Use Cases
• Actors
UML Introduction 14
Visitor
Staff
Patient
Person NormalUse
<<includes>>
<<includes>>
PressDoorButton
<<extends>>
EnterLiftCage
ExitLiftCage
Normal use of a
hospital lift
15. www.spiraltrain.nl
Logical View
• Class Diagrams model structure of objects and relationships :
• Classes
• Objects
UML Introduction 15
Lift system
DoorButton Chime
sound()
Door
FloorRequestButton
Shaft
LiftCage
22 111010
11
Lift System (modeling structure)
16. www.spiraltrain.nl
• Interaction diagrams model interactions between objects :
• Objects
• Messages
Logical View
UML Introduction 16
Lift System (behavior model)
DoorButton Chime
sound()
Door
FloorRequestButton
Shaft
LiftCage
22 11
1010
11
: Person
upButton : LiftCagefloorRequestButton: Door
press( )
doorIsClosed ()
press()
visit(j)
close()
pass
pass
visit(i)
open( )
atFloor(i)
atFloor(j)
open( )
17. www.spiraltrain.nl
Logical View
• Statechart Diagrams model behavior of individual objects :
• States
• Transitions
• Events (messages)
UML Introduction 17
Opening
do: opening()
Closing
do: closing()
entry: detector.enable()
exit: detector.disable()
Closed
open()
stopClosing()
Open
after( closureTimeOut )
close()
Door model
(behavior)
19. www.spiraltrain.nl
Deployment View
• Deployment Diagrams :
• Show the physical distribution of components over processors
UML Introduction 19
or
CompA CompB CompC
Telemetry Node
Location of components
on nodes
Telemetry Node
CompA CompB
20. www.spiraltrain.nl
UML Common Mechanisms
• Specifications
• Adornments
• Notes attach information to a model
• Common divisions
• Extensibility mechanisms
• Stereotypes extend the vocabulary of the UML
• Tagged values extend the properties of the UML
• Constraints extend the semantics of the UML
UML Introduction 20
21. www.spiraltrain.nl
Notes and other Adornments
UML Introduction 21
See http://www.spiraltrain.nl
for an example of this applet
embedded URL
See language.doc
for details about the language
implementation.
Consider using the factory design
pattern here. Emb 5/11/99
simple text
link to document
Client
bill.exe
report.exe
contacts.exe
Transaction
addAction()
removeAction
perform()
Exceptions
emptyTransaction
nosuchAction
resourceLocked
anonymous compartment
named compartment
22. www.spiraltrain.nl
Stereotypes
• New kind of model element based on existing element
• Just like existing element but with extra semantics
• Defined when stereotype is defined
• Can be based on all kind of model elements and used in the same situations
• Predefined stereotypes enable adjustment model elements
• Representation of stereotypes
• Name as a string between angle brackets above the model element
• Also possible is an own graphical representation
• Most requested new model elements
UML Introduction 22
<<Actor>>
Customer
<<Exception>>
Overflow !
named stereotype named stereotype
with icon
stereotyped element
As icon
X-axis Position
Sensor
RS-485
23. www.spiraltrain.nl
Tagged Values
• Properties of model elements :
• Name-value pairs, also called tagged values
• New tagged values can be added to hold additional information
• Any type of information can be attached to model elements :
• Method specific information
• Administrative information about progress
• Any other kind of information
UML Introduction 23
Instrument
{abstract}
{author=“HEE”}
{status= draft}
value : int
expdate : Date
Server
{processors = 8}
<<library>>
Trans.dll
{serverOnly}
tagged value
value of tag
24. www.spiraltrain.nl
Constraints
• Specify conditions that must be true for a well formed model :
• Value constraints on class attributes
• Constraint on an association that communication is encrypted
• Constraint that only one association is active at a time
• Constraint modeling in UML :
• Free-form text between brackets
• More formally described by OCL (Object Constraint Language)
• A number of constraints are predefined in UML :
• xor, subset, overlapping, disjoint
UML Introduction 24
{subset}
Department
Person
member manager
**
1..* 1
25. www.spiraltrain.nl
Summary : UML Introduction
• UML is a language for modeling systems :
• Mechanical systems, Electronic systems, Software systems
• UML is constructed specifically to enable modeling of objects :
• Their structure, behavior and interaction
• UML has four plus one views on particular system aspects :
• Use Case View, Logical View , Component View, Process View, Deployment View
• UML offers a diagrammatic language-syntax :
• Each view is described with view specific diagrams
• Models must satisfy the syntactic rules and must be consistent
• UML has following extensibility mechanisms :
• Stereotypes extend the vocabulary of the UML
• Tagged values extend the properties of the UML
• UML supports modeling of constraints :
• In free-form text between brackets or
• Formally in OCL (Object Constraint Language)
UML Introduction 25
Exercise 1
Getting Started