What Is UML?: Essentials of IBM® Rational® Rhapsody® For Software Engineers
What Is UML?: Essentials of IBM® Rational® Rhapsody® For Software Engineers
Communication Sequence
Diagrams Interaction Diagrams
Diagrams
3 4
Sequence diagram Class diagram
Sequence Diagrams show how instances communicate Class diagrams show classes and relations between
over time. them.
5 6
7 8
state chart diagram Activity diagram
state charts are used when you need to wait until Activity diagrams are used to
something happens before going to a different state. describe behavior for operations,
classes, or use cases. As soon
as one activity finishes, the next
one starts.
9 10
11 12
Component diagram Deployment diagram
A component diagram shows how components such as A Deployment Diagram shows how UML artifacts are
.exe, .dll, .lib, are interconnected. deployed onto hardware nodes.
13 14
Transceiver
Idle
Receiving
sd sd
Sending
Coil Driver
transm it(value) evDone
Receiving::High
Receving::Low {1 m s +/- 0.2m s}
Sending::High
Sending::Low
{3 m s +/- 0.2m s}
Tristate tm (bitTim e)
Monitor
send(value)
Initializing
Acquiring
ref
Reporting
dispatch_event
Idle
Time
15 16
How does UML apply to real-time? How do you describe structure using UML?
Real-Time UML is standard UML
“Although there have been a number of calls to extend UML for
the real-time domain … experience had proven this is not
necessary.” Bran Selic, Communications of the ACM, Oct 1999
Real-time and embedded applications
Special concerns about quality of service (QoS)
Special concerns about low-level programming
Special concerns about safety and reliability
Real-time UML is about applying the UML to meet the
specialized concerns of the real-time and embedded
domains
17 18
19 20
A radio A digital camera
Responsibilities: Responsibilities:
Allow the user to listen to desired radio frequency Take digital photos
Attributes: Attributes:
Wavelength Available Memory
Frequency Picture Resolution
Volume Battery Level
Behaviors: Behaviors:
Tune to a frequency Select Resolution
Store / Recall a frequency Focus
Change volume Take Photo
Switch on / off Upload Photos
21 22
23 24
Object identity Object views
All objects are unique even if their attributes are the same Objects have generally two different
as another. views:
For example, in this room, there are probably many Public view:
mobile phones, of which several might well be identical. This is the view that can be seen from
Even if they are identical, they are all unique. outside of the object.
Private view:
This is the internal only view, access is
controlled and the details are hidden
from the outside world.
25 26
27 28
Object operations UML class
Objects execute operations to implement behavior: A Class is the definition or specification of an object.
An object is an instance of a class.
Operations are primitive behaviors such as:
An object has the attributes and behaviors defined by its class.
++x A class can be shown on a Class Diagram in one of many ways.
y = sin(x)^2 + cos(x)^2 On some diagrams, you might want to show just the name of the class.
z = mySensor->getValue() Sometimes, you might want to show just the operations; other times, you
Operations can manipulate the attributes, call other might want to show all attributes and all operations.
operations.
Operations can be invoked from other objects as well as
from a state chart or activity diagram attached to the Attributes
object.
Name
Operations
29 30
Implicit
object
It is not necessary
to show every
attribute, every
operation, visibility,
…
31 32
Visibility defined Constructors and destructors
Attributes and Methods or Operations are features of a class. Every Class has a couple of special operations allowing
Features have the visibility adornments: Objects to be constructed / destroyed.
+ public A constructor is always called when an Object is created
Accessible by any client of the class. and generally initializes its attributes.
# protected A destructor is always called when the Object is
Accessible only from within the same class or subclasses. destroyed and ensures that any allocated resources are
- private properly returned.
Accessible only from within the same class.
Constructor
Rather than using these
symbols, Rational
Rhapsody uses more
graphical ones which are
easier to understand.
Destructor
33 34
37 38
39 40
Physical devices Key concepts
Very common approach in embedded systems. These are the fundamental abstractions in the domain.
Devices are often modeled as classes and objects. These concepts often have no physical manifestation.
ECG Example:
Examples:
Heart
A/D converter UI Domain Window, Icon, Cursor, Tool Bar, …
Switch Robotics Task plan
Button Banking Account
OS Thread
Physical devices are modeled either as
interfaces to the actual hardware (actual Navigation Waypoint
behavior is in the hardware, the software class
provides a means for objects to talk to it) or, less
commonly, simulations (simulates actual
hardware behavior).
41 42
43 44
Control elements Walking through scenarios
Entities that control other objects Scenarios consist of objects interacting in specific ways
A specific type of causal agent over time.
Examples:
Transaction controller in database Allow testing of class and object models:
Are all necessary facilities and services available?
Audio and video synchronizer
Do the object’s attributes and behaviors support its
Autopilot responsibilities?
Clothes washer cycle controller
45 46