UML Basics: Grady Booch & Ivar Jacobson
UML Basics: Grady Booch & Ivar Jacobson
UML Basics: Grady Booch & Ivar Jacobson
Logical Implementation
View View
End-user Programmers
Functionality Software management
Use Case
View
Process Deployment
View
System integrators View System engineering
Performance System topology
Scalability Delivery, installation
Throughput Communication
Conceptu Physical
al
Relation Between Views
Process view
β
Deployment view
What is the UML?
General-purpose OO modeling language
- convergence of a number of popular OO
methods
UML
OMT 1.4
(Rumbaugh et al)
Mar. 1999
1996
OOSE
(Jacobson et al)
Catalysis ROOM etc.
The Value of the UML
Is an open standard
Supports the entire software development
lifecycle
Supports diverse applications areas
Is based on experience and needs of the
user community
Supported by many tools
Contributions to the UML
Harel
Meyer Gamma, et al
Statecharts
Before and after Frameworks and patterns,
conditions
HP Fusion
Booch
Operation descriptions and
Booch method message numbering
Embley
Rumbaugh
Singleton classes and
OMT
high-level view
Jacobson Wirfs-Brock
OOSE
Responsibilities
Behavioral elements
- interaction, state machine
Grouping elements
- package, subsystem
Other elements
- note
The Object Paradigm
A synergistic combination of various proven
techniques including:
- encapsulation
- inheritance
- polymorphism/genericity
- Layering
- Communication (links)
Objects
Entities that model some physical or
conceptual entity
- a unique identity (dedicated memory)
the conceptual becomes physical!
- a public interface
- a hidden (encapsulated) implementation
methods
public
attributes Telephone1: void:offHook ();
{busy = true;
public +busy : boolean …
reqDialtone();
operations };
+offHook()
+onHook ()
+ring()
Conceptual Objects
Not all objects necessarily require a physical
underpinning
For example, the “telephone call” object:
Telephone1 Telephone2
Telephone Call
Telephone Call Object
abortCall ()
addParty (t:Telephone)
reportDuration ()
Classes and Instances
Design-time specifications for one or more
distinct objects with a common form
(structure and behavior)
instance
(run time)
class phone1:Telephone
(design time)
busy = true
offHook()
onHook ()
Telephone ring()
phone2:Telephone
busy : boolean
busy = false
offHook()
onHook () offHook()
ring() onHook ()
ring()
Object Behavior
Simple basic reactive server model:
Initialize
Object
CallProc:
3.sendTone()
2.call()
PhoneIF: ToneGen:
1.offHook()
4.dialtone()
Object “Engines”
Passive objects: depend on external motive
power (e.g., “main” program thread)
Active objects: self-powered (own thread
of execution)
Initialize Initialize
Object Object
Handle Handle
Request Request
Terminate Terminate
Object Object
Inheritance and Polymorphism
Generalization and re-use mechanisms
TelephoneClass
busy : boolean
Generalization
offHook()
(inheritance)
onHook ()
dialDigit() association
TouchTone RotaryDial
TelephoneClass TelephoneClass
busy : boolean Polymorphism: busy : boolean
offHook() an operation offHook()
onHook () implemented onHook ()
dialDigit() differently in dialDigit()
playTone() different classes
Models, Views, and Diagrams
model is a complete
escription of a system
om a particular
State
erspective State
Diagrams
Class
Diagrams
Use Case Diagrams
Use Case
Diagrams State
Use Case Use Case
Diagrams State
Diagrams
Use Case Diagrams Object
Diagrams
Diagrams
Sequence Diagrams
Diagrams
Diagrams
Scenario State
Scenario
Diagrams State
Diagrams
Collaboration
Diagrams Models Component
Diagrams
Diagrams Diagrams
Scenario Component
Scenario
Diagrams
Component
Diagrams
Deployment
Statechart
Diagrams Diagrams
Diagrams Diagrams
Activity
Diagrams
Diagrams
A diagram is a view into a model
- Presented from the aspect of a particular
stakeholder
- Provides a partial representation of the system
- Is semantically consistent with other views
<Insert your
description here>
Use Case
Student
Clos e Registration
Billing System
(from Use Cases)
Key Concept : Use Case Relationships
Include
- To factor out common
behavior.
Extend <<include>>
- To factor out optional or
exceptional parts of a
use case.
<<extend>>
Generalization
- To share purpose,
structure, and behavior.
Use Case Diagram
Captures system functionality as seen by
users
Use Case Diagram (contd.)
Captures system functionality as seen by
users
Built in early stages of development
Purpose
- Specify the context of a system
- Capture the requirements of a system
- Validate a system’s architecture
- Drive implementation and generate test cases
Developed by analysts and domain experts
Super and Sub-ordinate Systems
<<super-ordinate system>>
S Actor3
<<subsystem>> <<subsystem>>
<<subsystem>>
sub-a sub-b
sub-c
X
Y
Actor1 <<subsystem>>
Z c
Actor2 Yc
<<subsystem>> <<subsystem>> Zc
a b
Actor3
Xb Sub b
Xa
Actor1 Sub a Yb
Ya
Zb
Based upon Software Reuse, Jacobson et al - 1997
Actor2
Use Case Anatomy
<<super-ordinate system>>
S
<<include
<<include >>
>>
<<subsystem>>
<<subsystem>> b
a
X
X b
a
X
X <<realisat
ion>>
<<view>>
implementation
<<realisat
ion>>
X
<<realisat <<realisat
ion>> ion>>
<<view>>
<<view>> deployment
process
X
X
<<view>>
logical
<<view>>
Implementation
<<realisat
ion>> b
a 2
1
b b
1 3
<<view>>
Process
<<view>>
Deployment
<<realisat
ion>>
<<Processor> <<Processor>
> >
Laptop Server
Proc 1 Proc 3
Proc 2
Design Implementation
View View
Classes, interfaces,
collaborations Components
Use cases
Use Case
View
Process Deployment
View View
Organization Dynamics
Package, subsystem
Interaction
State machine
Active Objects in the UML
Concurrent incoming events are queued and
handled one-at-a-time regardless of priority
- run-to-completion (RTC) execution model
ActiveObject:
RTC 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
ActiveObject: passive
encapsulated
objects
(protected
The event attributes)
handler is an
implicit critical
region
RTC 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
Signals
Used for asynchronous communication
- specified by a special type of class
- can be organized into class hierarchies
«signal»
Alarm
severity : integer
«signal» «signal»
FireAlarm MedicalEmergency
Channel1
TerminalA TerminalB
Application Layer
Channel2
Library
System1
Channel1
Terminal
TerminalA TerminalB
Channel2
Channel
System2
Terminal
Tester Terminal
TerminalA
Tester
Refining Architectures (Reuse)
Channel1
TerminalA TerminalB
Channel1
TerminalA TerminalB
Channel2
Approach and Method
The necessary architectural modeling capabilities can
be found in ROOM
Express the architectural modeling concepts of ROOM
using standard UML
Real-time specific library of UML stereotypes
Ports
Capsules: Behavior
Optional hierarchical state machine
(signal handler with run-to-completion
semantics) transitionS1toS2:
{int x;
x = 0;
p2.send(s1);
p3.send(s2);
S1 …
};
S2 S3
Capsules: UML Modeling
Stereotype of Class concept («capsule»)
with specialized (executable) semantics
Class diagram representation:
«capsule»
CapsuleClassX
#counter : int
#x : char
ports
+portB : ProtocolA::master
#portC : ProtocolB
Protocols: Contractual Behavior Patterns
ack
number
call
ack
transfer
talk
time
Protocol Specifications
A special form of collaboration
Alice Bob
caller OperatorAssisted callee
Call
Charlie
Dexter
connecting
connected
Protocol Roles
Specifies one party in a protocol
significant sequences
Incoming signals
caller operator callee
signal source
call caller
number caller
ack callee
OperatorRole
Outgoing signals role state machine
signal target
call callee initial
transfer caller
connecting
ack caller
connected
Protocol Refinement
Using inheritance
outgoing
call
number
talk
1 1
«protocolRole» «protocolRole»
operator callee
Ports: Boundary Objects
Fully isolate a capsule’s implementation
from its environment (in both directions)
Capsule
S1
Environment
S2
Ports and Protocols
Each port realizes a single protocol role
(type)
- Multiple ports with same type possible
«capsule»
CapsuleClassX
ports
+portA : ProtocolA::master
#portB : ProtocolB
+portC : ProtocolB~
Ports: Collaboration Diagram Notation
portA : ProtocolA::master
«capsule»
anX:CapsuleClassX
1 «port»
portA:ProtocolA::master
Combining Capsules
Using connectors
remote : FaxProt
«capsule» «capsule»
sender : Fax receiver : Fax
remote : FaxProt
Connector
Relay
sendCtrl : Control port receiveCtrl : Control
c : Control c : Control
remote:FaxProt
«capsule» «capsule»
sender:Fax receiver:Fax
Remote:FaxProt
FaxCall
Composite Capsule Semantics
Run-time assertion: the complete internal
structure of a composite is automatically
created (recursively, if necessary) when the
capsule is created
f1 := create(FaxCall);
«capsule» «capsule»
sender:Fax receiver:Fax
f1:FaxCall
Benefits of Run-Time Assertion
Architectural enforcement: only explicitly prescribed
architectural structures can be instantiated
- it is not possible to bypass (corrupt) the
architecture by low-level programming
initial
connecting
c : Control connected c : Control
«capsule» «capsule»
sender:Fax receiver:Fax
Decomposition : Class Diagram View
Alternative representation
- More abstract
1 «capsule»
sender Fax
1 receiver
«capsule»
FaxCall
Summary (1)
ROOM
- B. Selic, G. Gullekson, and P. Ward, “Real-
Time Object-Oriented Modeling”,
- John Wiley & Sons, NY, 1994.
Future
UML 1.4 and Beyond
ADL: Architecture Description Languages
- UML, UniCon, LILEAnna, P++, LEAP, Wright,
µRapid
Standardization of concepts
- IEEE Working Group on Architecture
- INCOSE Working Group on System
Architecture
Systematic capture of architectural patterns
References (Architecture)
Len Bass, Paul Clements & Rick Kazman, Software Architecture in
Practice, Addison-Wesley, 1998.
Frank Buschmann, Régine Meunier, Hans Rohnert, Peter Sommerlad,
and Michael Stahl, Pattern-Oriented Software Architecture - A System
of Patterns, Wiley and Sons, 1996.
Christine Hofmeister, Robert Nord, Dilip Soni, Applied Software
Architecture, Addison-Wesley 1999.
Eric Gamma, John Vlissides, Richard Helm, Ralph Johnson, Design
Patterns, Addison-Wesley 1995.
Philippe Kruchten, “The 4+1 View Model of Architecture,” IEEE
Software, 12 (6), November 1995, IEEE.
- http://www.rational.com/support/techpapers/ieee/