Title: A Brief Overview of the Unified Modeling Language
1A Brief Overview of the Unified Modeling Language
- Bran SelicObjecTime Limited
- bran_at_objectime.com
Rev.2
2Overview
- Introduction
- The Object Paradigm
- Modeling with the UML
- Summary
3What is the UML?
- General-purpose OO modeling language
- convergence of a number of popular OO methods
Catalysis
ROOM
etc.
4Inside the Standard
- Semi-formal semantic meta model
- defines the basic modeling concepts
- object, class, association, etc.
- includes formal well-formedness rules expressed
as constraints in the Object Constraint Language
(OCL) - Graphical notation for modeling concepts
- 8 different diagram types
- Two predefined domain extensions
5- Introduction
- The Object Paradigm
- Modeling with the UML
- Summary
6A Brief History of Objects
- 1967 Simula programming language
- 1970s Smalltalk programming language
- 1980s Theoretical foundations, C,
Objective-C, etc. - 1990s Object-oriented analysis and design
methodologies (Booch, OMT, ROOM, etc.), Java - 1997 The Unified Modeling Language (UML)
standardized by the Object Management Group (OMG)
7The Object Paradigm
- A synergistic combination of various proven
techniques including - encapsulation
- inheritance
- polymorphism/genericity
- Salient characteristic a software system is
rendered as a structure of collaborating parts - the object paradigm is inherently structural
8Structure
- The individual parts of a system and their
run-time topological relationships - Fundamental structural relationship types
- Containment (strong and weak)
composition (strong)
aggregation (weak)
9Objects
- Entities that model some physical or conceptual
entity - a unique identity (dedicated memory)
- the conceptual becomes physical!
- a hidden (encapsulated) implementation
methods
public attributes
Telephone1
busy boolean
public operations
offHook() onHook () ring()
10Conceptual Objects
- Not all objects necessarily require a physical
underpinning - For example, the telephone call object
abortCall () addParty (tTelephone) reportDuration
()
11Classes and Instances
- Design-time specifications for one or more
distinct objects with a common form (structure
and behavior)
instance (run time)
class (design time)
12Object Behavior
- Simple basic reactive server model
InitializeObject
Handling depends on specific request type and
object state
Wait forRequest
HandleRequest
Invokes operations on other objects
TerminateObject
13Programming Model
- Combining objects into object structures
14Object Engines
- Passive objects depend on external motive power
(e.g., main program thread)
- Active objects self-powered (own thread of
execution)
15Inheritance and Polymorphism
- Generalization and re-use mechanisms
Generalization (inheritance) association
16- Introduction
- The Object Paradigm
- Modeling with the UML
- Summary
17Why Build Models?
- To understand the problem better
- To communicate with stakeholders
- To find errors or omissions
- To plan out the design
- To generate code
18UML Model Views
- Requirements (use case diagrams)
- Static structure (class diagrams)
- kinds of objects and their relationships
- Dynamic behavior (state machines)
- possible life histories of an object
- Interactive behavior (activity, sequence, and
collaboration diagrams) - flow of control among objects to achieve
system-level behavior - Physical implementation structures (component and
deployment diagrams) - software modules and deployment on physical nodes
19Class Diagram - Static Structure
- Shows the entities in a system and their general
relationships
association class
Person
generalization
association
residence
0..
ordered
House
20Object Instance Diagram
- Shows object instances in a particular case
link
21State Machine Diagram
- Each state corresponds to a selective receive
action
state machine
initial state
state
trigger
action expression
final state
transition
22State Machine Behavior
- Event handling details depend on state
start/master.ready()
23Active Objects in the UML
- Concurrent incoming events are queued and handled
one-at-a-time regardless of priority - run-to-completion (RTC) execution model
24RTC and Concurrency
- Eliminates need to write complex and error-prone
synchronization code - if all passive objects encapsulated by an active
object, only a single thread can pass through
each passive object
passive encapsulated objects (protected
attributes)
The event handler is an implicit critical region
25RTC Semantics
- RTC step semantics must not be confused with
uninterruptibility or unpre-emptabilty - interrupts do not have to be blocked
- an active object can be pre-empted by another
active object responding to a higher-priority
event - priority inversion only occurs when an active
object blocks itself (i.e. it cannot block any
other active object) - The effectiveness of this is supported by the
following empirical results - most event handling is trivial
- in computer terms, events occur infrequently
26State-Based Actions
- Entry action executed whenever a state is
(re-)entered - Exit action executed whenever a state is
departed - Internal transition a self transition executed
without leaving and re-entering a state
entry/m.entered() exit/m.departed() poll/m.ack
()
27Hierarchical States and Transitions
- Allows step-wise refinement and viewing of
complex behavior
group transition
default transition
composite state
28Signals
- Used for asynchronous communication
- specified by a special type of class
- can be organized into class hierarchies
29Sequence Diagrams
- Assertions of legal interactions between objects
(e.g., operator-assisted call)
sequence diagram
30Collaboration Diagram
- Show generic structure and behavior
classifier role
P2TTSet
P1BusSet
P2TTSet
P1BusSet
31- Introduction
- The Object Paradigm
- Modeling with the UML
- Summary
32Summary the UML
- An industry standard for analysis and design of
object-oriented systems - based on extensive experience and best practices
- gaining rapid acceptance (training, tools, books)
- Comprises
- set of modeling concepts
- graphical notation
- Leaf concepts organized into 8 diagram types
- class, state machine, collaboration, use case,
sequence, activity, component, deployment - The UML can be used in many different domains to
capture domain-specific concepts and ideas