Essentials of IBM Rational Rhapsody v7.5

Essentials of IBM Rational Rhapsody v7.5
®
IBM Software Group
Essentials of IBM® Rational® Rhapsody® v7.5 for Software
Engineers (C++)
Advanced Rational Rhapsody
© 2009 IBM Corporation
Objectives
 Now that you know the basics about Rational
Rhapsody, you should be able to start creating your
own projects. To confirm this, try to create a simple
project without any step-by-step instructions. There
are also many more topics that a developer needs to
understand and so by the end of this section, you
should have an understanding of topics such as:
The Rational Rhapsody Framework
Generating reports
Using the API
Using Configuration Management
Rational Rhapsody TestConductor
2
Advanced Rational Rhapsody
 Triggered Operations
 Introduction to the Rational Rhapsody Framework
 More about Containers
 Managing Interrupts
 Generating Reports
 Using the COM API
 Using the Java® API
 Introduction to Configuration Management
 Introduction to Rational Rhapsody TestConductor
 Stopwatch Exercise
 Speed Camera Exercise
 Useful Tips
3
Advanced Rational Rhapsody
Triggered
operations
4
Sending an event
 In the DishwasherSystem created previously
(Dishwasher if you did not save the model as
DishwasherSystem model), events such as evStart
were sent from the FrontPanel to the Dishwasher.
 The event was queued and then executed after a
certain delay that depends on how many other events
are in the event queue. The delay depends on how
many other events are in the event queue and as
such is not very deterministic.
 Another potential problem is that the FrontPanel
could send events faster than the Dishwasher could
handle them in which case the event queue might
overflow.
 A solution to these problems is to use a triggered
operation which is basically a synchronous event,
also known as a blocking call.
5
Triggered operation
 A triggered operation
can be used on a
transition in a Statechart the same way as an event.
 For example, you can change all the events in the
dishwasher to be triggered operations. It is often a
good idea to also change the prefix ev to tg.
6
Calling the triggered operations
 You can modify the processKey() operation in the
FrontPanel to call the triggered operations:
The syntax for
calling a triggered
operation is the
same as for an
operation.
7
Sequence diagram
 When executing the
model, you can see the
difference between an
event and a triggered
operation:
Synchronous call
Asynchronous call
8
Triggered operation code
Statechart
transition blocks
the caller.
9
Invoking triggered operations
 In order to invoke a
triggered operation or a
primitive operation from
the animation bar, it is
best to first use the
Advanced settings and
set Enable Operation
Calls to Public or All.
10
Calling operations
 Once the code is regenerated and rebuilt, the
key
can be used to invoke operations.
11
Advanced Rational Rhapsody
Introduction to the
Rational Rhapsody
framework
12
Framework
External
Code
 The Rational Rhapsody framework is a collection of
base classes and interfaces that are used by the
code generated from a users model.
Rational Rhapsody
Generated Code
OXF Framework
RTOS
CPU
 There are two main parts to this framework:
1. The
Object eXecution Framework (OXF), which is the part
of the framework that will always be linked into the final
generated code.
2. The Animation and Tracing Framework, which is only used
when animating or tracing and as such is less important to
understand than the OXF.
13
Object eXecution Framework organization

The OXF Framework is created directly from a
Rational Rhapsody model.
(See <RhapsodyInstall>\Share\LangCpp\oxf\model\oxf.rpy).
There are three main parts to the Object eXecution
Framework
1.
2.
3.
Event Driven Framework (Core and Core Implementation
package)
Operating System Adapter Layer (Adapters package)
Container Classes (Part of Services package)
External
Code

Rational Rhapsody
Generated Code
OXF Framework
RTOS
CPU
Container
Classes
14
Event Driven Framework
Operating System Adapter Layer
Object eXecution framework model
 The OXF Framework consists of many different
nested packages enabling it to be built in a scaleable
fashion to include only the required functionality.
 There is a set of
interfaces in CoreAPI and
a default implementation
in CoreImplementation for
the framework behavior.
This allows you provide
your own Implementation
yet not break the
automated code
generation process.
15
Event driven framework interfaces
 These are the principal interface classes in the
Event Driven Framework:
IOxfActive
IOxfReactive
IOxfEvent
IOxfTimeout
16
Event driven framework implementation
 These are the principal classes of the default Event
Driven Framework implementation:
OMThread
OMReactive
OMEvent
OMTimeout
OMProtected
OMTimerManager
OMMemoryManager
17
OMEvent
 OMEvent – Base class for all signal and timed events:
 OMEvents have an unique ID.
 They know the address of their
destination (receiving reactive
object).
 There are specific Framework
events for internal usage.
 Events may – or may not be
deleted after consumption (if static).
 They may provide their own custom
destroy() operation, for example, to
reuse the event in a memory pool.
18
OMTimeout
 OMTimeout – Base class for all Rational Rhapsody
timed events:
 They inherit everything from
OMEvent.
 OMTimeout events have a
special ID.
 They add a delay time attribute.
 They may be canceled before
they matured, but also after
already being queued.
19
OMReactive
 OMReactive – Base class for all reactive classes (for
example, all classes with statecharts).
OMReactive knows the thread it runs on.
It provides send() operations in order to
put events into the input message queue
of its active class via OMThread::queue().
It provides the operations handleEvent()
(for asynchronous signal events) and
handleTrigger() (for synchronous events).
It provides operations to schedule and
cancel relative timeouts.
Finally it defines virtual operations for the
code generator in order to implement the
statemachine of the application class, for
example, rootState_processEvent().
20
OMThread
 OMThread – Base class for all «active» objects for
multi-threaded applications.
 OMThread creates one event
Queue and a dispatchingGuard
and runs its execute()
operation in an operating
system thread.
 The operation queue() allows
you to put events of type
IOxfEvent into the message
queue.
 execute() by default reads
messages from the queue and
dispatch() them calling the
reactive destination’s
handleEvent().
21
OMThread
 Each OXF thread waits on an event queue for
incoming events:
OMReactive* OMThread::execute() {
for ( ;; ) {
while ( !eventQueue->isEmpty() ) {
IOxfEvent *event = eventQueue->get();
IOxfReactive *dest = event->getDestination();
dest->handleEvent(event);
delete event;
}
eventQueue->pend();
}
}
 The above is a simplified version of the main loop
operation in an OXF thread. It is named execute().
 This operation may be overloaded in order to read
from other blocking devices, rather than read OXF
message queues. This is what was done in the
KeyReader class in the CashRegister example.
22
Client server OXF sequence - sending
23
Client server OXF sequence - receiving
24
OMProtected
 OMProtected is used to
protect an operation from
concurrent access. To do
so, set the property
CG:Operation:Concurrency
from sequential to guarded.
 This protects this operation
with OMProtected (which is
basically a mutex).
For more info, see the
OMProtected.h file.
25
OMMemoryManager
 The framework includes a memory manager that
overrides new and delete to allocate memory.
For more info, see the
OMMemoryManager.h file.
26
Extending memory management
 There are two ways to override memory allocation:
 Use the static architecture
properties so that memory will
be allocated statically using
memory pools.
 Provide a custom memory
manager class.
27
Interrupt driven framework
External
Code
 By using the interrupt driven framework
(IDF), it is possible to use Rational
Rhapsody in C++ without the need for an
Operating System.
 The IDF can replace the OXF and RTOS.
 It generates smaller code.
 Requires just a periodic interrupt to be
configured (so that timeouts can be used
in statecharts).
 The IDF is supplied in a Rational
Rhapsody in C++ model
RiCpp_InterruptDrivenFramework.rpy.
Rational Rhapsody
Generated Code
IDF Framework
For more info, see the documentation included in
the V73_RiCpp_InterruptDrivenFramework model.
CPU
28
Synchronous framework
External
Code
 The standard frameworks ( OXF and IDF ) both allow
asynchronous and synchronous communication.
 If only synchronous communication is desired so that
the behavior is deterministic, then triggered operations
can be used instead of events.
Rational Rhapsody
Generated Code
 In this case, the majority of the
SF Framework
framework is redundant.
CPU
 The Synchronous Framework is just the bare
minimum framework necessary to allow the use of
triggered operations.
 The Synchronous Framework does not require an OS.
and as such, active classes are not supported.
 Timeouts and events are not supported.
 Has a smaller footprint than the IDF.
29
No framework
 If the framework is not required, then you can simply
set the stereotype «NoFramework» to the
configuration.
 Of course without the framework, there will be no
code generation for active classes, ports, state charts,
relations with unbounded multiplicity and so on.
This stereotype is provided in
the same profile used during
the CashRegister exercise.
30
Container classes
 Template based containers
OMList<Concept>
OMCollection<Concept>
OMMap<Key,Concept>
OMIterator<Concept>
 Untyped containers (do not use templates)
OMUList
OMUCollection
OMUMap
OMUIterator
 Miscellaneous
These classes are in
Rhapsody\Share\LangCpp\oxf.
OMString
OMBoolean
31
Operating system adapter layer
 In order to be able to work with almost any Operating
System, Rational Rhapsody provides a thin Operating
System Adapter Layer that describes the services
required of an OS.
 When ever the application needs to use an OS
service such as creating a mutex, it does so via this
adapter layer.
 This gives the advantage of being able to easily
interchange Operating Systems, such as being able
to test on the host using Windows, then deploying on
a target with INTEGRITY, VxWorks, Windows CE,
OSE, Nucleus, Linux, ThreadX, QNX, pSOS …
 The adapter layer is implemented using the Abstract
Factory design pattern.
32
Adapter interface
33
NT adapter
34
VxWorks adapter
35
INTEGRITY adapter
36
Nucleus adapter
OMOSFactory
NuOSFactory
OMOSThread
OMOSEventFlag
OMOSMutex
OMOSMessageQueue
OMOSTimer
NuThread
NuOSEventFlag
NuMutex
NuOSMessageQueue
NuTimer
37
OMOSSemaphore
NuOSSemaphore
Using the adapter
 For example to use a mutex:
Create an attribute of type OMOSMutex*:
OMOSMutex* itsMutex;
Create using :
itsMutex = OMOSFactory::instance()>createOMOSMutex();
Locking:
itsMutex->lock();
Unlocking:
itsMutex->unlock();
If you use this method for
creating event flags,
mutexes, and semaphores,
then it works on all OSs.
38
Advanced Rational Rhapsody
More about
containers
39
OMContainers
 You have seen that for
the relation of
multiplicity *, Rational
Rhapsody generates
the following:
OMList<Observer*>
OMCollection<Observer*>
OMMap<int,Observer*>
40
Using an OMContainer
41
STLContainers
 If you set the property
ContainerSet to
STLContainers, then
Rational Rhapsody uses
the STL (standard
template library).
list<Observer*>
vector<Observer*>
map<int,Observer*>
42
Using an STL container
Make sure that you use
++iter rather than iter++,
since this avoids the
creation of a temporary
object.
43
OMUContainers
 If you set the property
ContainerSet to
OMUContainers then
Rational Rhapsody uses
the untyped containers:
OMUList
OMUCollection
OMUMap
44
Using an OMUContainer
These containers do not use
templates. Templates can
sometimes be a problem for
some compilers.
45
Static arrays
 Sometimes it is more efficient (though less safe) to
use a static array.
 To use a static array, the multiplicity must be
bounded, for example, MAX_OBSERVERS.
46
Advanced Rational Rhapsody
Managing interrupts
47
Interrupt service routines
 Setting up interrupt service routines varies from one
CPU to another and from one OS to another. With
Rational Rhapsody, you should use the same method
you would use without Rational Rhapsody.
 Example: with VxWorks:
 The ISR routine must be static and non-animated.
48
Sending events from ISR routines
 To send an event from an ISR routine, there is a
special macro GEN_ISR that can be used.
See the
InterruptHandler
model for more
info.
49
Advanced Rational Rhapsody
Generating reports
50
Reports
 There are two ways in which you can generate a report,
Report on model or ReporterPlus.
 The first way is to select Tools > Report on model to
generate a quick but simple rtf format file:
51
Report on model
 This generates a
simple rich text
format (RTF) file.
 The report
generation is very
quick, but there is
little control over
the formatting.
52
Rational Rhapsody ReporterPLUS
 With the Rational Rhapsody ReporterPLUS, you can
generate HTML, RTF, Word or PowerPoint files. You
can also use off the shelf or customize your own
templates to format the documentation as you want.
 Rational Rhapsody ReporterPLUS has a graphical
IDE for creating templates.
53
Rational Rhapsody ReporterPLUS IDE
 The IDE allows
templates to be
created graphically
by drag and drop.
54
CashRegister.doc
55
CashRegister.html
56
Advanced Rational Rhapsody
Using the COM API
57
Simple VBA macro
 In the Case Study, you
entered several use case
descriptions, all of which
were based on the same
template.
 You can create a VBA
macro to facilitate this.
 Start the Visual Basic
editor.
58
Module
 Insert a new module:
59
Writing a macro
 Write the following macro then select File >
Close and Return to Rhapsody.
60
Adding a helper
 You want to be able to
call this macro whenever
you are working with a
use case.
 Add a helper as follows:
61
Calling the macro
 The macro can now be invoked by right-clicking on
any use-case.
This simple macro only
formats use cases that
have an empty
description.
62
Advanced Rational Rhapsody
Using the Java API
63
Simple Java program
 Instead of using VBA and the COM API, you can
use the Java API to format the use case.
 You can use Eclipse to create a Java project that
references the Rational Rhapsody Java API:
64
FormatUseCaseHelper.java
65
Running the Java program
 To run the Java program
from within the Eclipse
environment or the VBA
macro, you can add a
helper to invoke the
program by right-clicking
on a use case.
-Djava.class.path=$OMROOT\javaApi\rhapsody.jar;D:\eclipse\JavaApps\FormatUseCaseHelper Djava.library.path=$OMROOT\javaApi com.rhapsody.helpers.FormatUseCaseHelper
66
Rational Rhapsody plug-in
 To get better
performance
from the Java
program, write
it as a Rational
Rhapsody
plug-in and
then create a
jar file from it.
67
Helper file: FormatUseCase.hep
 Write a helper file so that the plug-in gets loaded
every time that Rational Rhapsody starts.
68
Loading a helper file
 Add the following to the site.prp or siteC++.prp file to
load the helper file:
 Now, next time that Rational Rhapsody is started,
you can format a use case example.
69
Model checker
 Some checks are run every time that code is
generated, for example checking to ensure that there
is a default transition.
 You can run the same checks as well as others using
Tools > Check Model.
70
Custom checks


You can use the API to write your own model
checks that can be added to the built in checks.
For example you could add checks to do the
following:
1. Ensure that if a history connector is present, then it is
initialized.
2. Ensure that there are no redundant classes, (generally
these are classes that were added inadvertently and
usually have a name that ends in _0, _1, …).
3. Ensure that there are not any possible redundant
relations, generally these are classes that were added
inadvertently and usually have a name that ends in _1,
_2, …).
71
CustomChecksHelper
72
HistoryCheck
See
CustomChecksHelper.zip
for complete code.
73
Helper file
 The checks can be added via a Helper file:
74
Custom checks
 Every time that Rational Rhapsody generates code,
the custom checks are executed.
75
Advanced Rational Rhapsody
Introduction to
configuration
management
76
Configuration management
 Rational Rhapsody can attach to many CM tools
such as Rational Synergy, PVCS Dimensions, PVCS
Version Manager, Rational ClearCase, Visual
SourceSafe, SourceIntegrity, and so on.
 The connection can be done by using either the
SCC interface or the command line interface. The
selection is made in the project properties (or can be
setup in the site.prp file).
 Rational Rhapsody checks in and out parts of the
model, these parts are called units.
 Units checked out without a lock are read-only.
In order to work with Subversion or CVS, then an SCC
plug-in must be obtained, for example, PushOk.
77
CM units
 These are the types of units that can be
checked in/out with the CM tool:
project
packages / profiles
object model diagrams
structure diagrams
sequence diagrams
components
use case diagrams
classes, actors & use cases
collaboration diagrams
component diagrams
deployment diagrams
panel diagrams
controlled files
78
.rpy files
.sbs files
.omd files
.std files
.msc files
.cmp files
.ucd files
.cls files
.clb files
.ctd files
.dpd files
.pld files
any extension
Units
 Each unit can be seen in the browser as having the
symbol.
 By default, only components, controlled files, profiles,
and packages are units.
 By default, diagrams, classes, actors, and use cases
are not units.
 To be able to check in/out a single diagram / class /
actor or use case, select it in the browser, right-click,
and select Create Unit.
Unit
79
SCC or command-line interface
 Before using the
Configuration
Management, you must
decide whether to use
the SCC interface or the
command-line interface.
To understand more about which
method to use, check out the
document:
\Doc\pdf_docs\team_collab_guide.pdf.
80
Configuration management options
 Before using the
configuration
management, there
are various options
that may need setting,
for example, what
should happen if a
model element gets
deleted, moved, or
renamed.
81
Using the SCC interface
Tree view
Flat view
82
Step 1: Connect to archive
 The first step is to connect to the archive:
The menus presented
may be different,
depending on the CM
tool present. The
menus shown here
are for Visual
SourceSafe.
83
Step 2: Add to archive
 Once connected to the archive, the model elements
need to be added to the archive.
 The simplest way to do this is to use the Tree view,
select the project, and then select Add to Archive.
84
Step 3: Checking out files
 Any model element that
is checked in is readonly.
 In order to work on that
model element, you
need to check it out.
85
What has changed?
 To see the difference between
the current model and the
archive, select the unit and press
the Diff with Rhapsody key.
 To see the difference
between two different
models, use the
Rational Rhapsody
DiffMerge tool.
86
Rational Rhapsody DiffMerge tool
 The two browsers are interposed. The Symbols
indicate where there are differences between
the models.
87
Viewing model differences
 You can view just the model differences:
88
Ignoring graphical differences
 By default, Rational Rhapsody DiffMerge
ignores any changes that are just
graphical, for example, where a class has
been moved on a diagram.
89
Viewing the diagram differences
 The differences can be all highlighted by using the
button.
 The button can be used to highlight the first
difference and the button used to highlight each
subsequent difference.
90
Merging
 The Rational Rhapsody DiffMerge tool can
be used to merge two models into one.
 The merge is started by using the
button.
 Either of the models can be used as a starting point
by using the
buttons.
 Then, model elements can be selected one by one.
 Finally, the merged model can be saved or merged
back to Rational Rhapsody.
91
Base-aware merge
 A base-aware merge can be done; ideally, this is
connected to a CM tool such as Rational Synergy or
Rational ClearCase to allow automatic merging.
 The Rational Rhapsody DiffMerge can be run to
perform a base-aware comparison and merge.
92
Base-aware Diff
93
CM status
 When using the SCC
interface, you can display
the status of each model
element in the browser:
This package has no
symbol, since it is not yet
Controlled by CM.
94
Add to model
 Add to model can be used to import units
from another model.
 The model can either be added to the
model as a unit (a Read-Write copy) or as
a reference (Read-Only Reference).
If Add Dependents
selected, then all
dependent units are
be added.
95
Working with large projects
 When working on a large model, you
often only need to work on just one
package at a time. Rather than loading
the entire model into Rational
Rhapsody, you can load just the units
that you want to work with.
Select Without
Subunits
Units can also
be unloaded.
96
Loading units
 The model is opened and
none of the units are
loaded. They have a
symbol (U) indicating that
they are unloaded.
 To load a unit, right-click
and load the unit either
with or without the
subunits (nested units).
97
Advanced Rational Rhapsody
Introduction to Rational
Rhapsody TestConductor
98
TestingProfile
 The Rational Rhapsody
TestingProfile provides a number
of stereotypes conforming to the
UML Testing Profile:
«SUT»
«TestCase»
«TestObjective»
«TestContext»
«TestComponent»
«TestConfiguration»
…
99
Testing phases
 Create a Test Architecture
 In order to start testing, you first need to select the
classes which you want to test. Then, create a test
architecture for them, so that you can test it
independently of the rest of the system. Creating this Test
Architecture can be done either manually or automatically.
 Create Test Cases
 Test Cases can be written in one of two ways, either:
 Graphically via sequence diagrams
 Manually via code, activity diagrams, or flow charts
 Execute Test Cases
 The test cases can be executed either interactively or in
batch mode, and any errors reported and analyzed.
100
Testing artifacts
 All testing artifacts are UML
model elements and can be
managed with configuration
management in the same way
as any other Rational
Rhapsody model element:
101
Test architecture
 A test architecture can be created by selecting a
class to test and then creating a test architecture
similar to the following:
102
TestScenario
 Once you have a test architecture, you can
start to describe test scenarios using sequence
diagrams such as the following:
103
Test Case: based on test scenarios
 A TestCase can play back
a number of TestScenarios
in a specific order to verify
that the messages received
are as expected.
 Each TestScenario may be
parameterized and used
several times with different
parameters.
104
Manual test cases
 If you have some complex structures that you want
to pass, or want to check return values or output
values, then this is difficult to do graphically with
sequence diagrams. In these cases, you can write
some manual test cases. You can either manually
write the code or you can use a flow chart:
105
Building the test context
 Before the TestCases can be run,
the TestContext must be built.
106
Executing the TestContext
 Each TestCase can be run:
107
Test results
 After the test completes, a
Test Result and a
CoverageResult is added to
the TestCase.
108
Running all the test cases
 All the TestCases can be run in
mode batch:
109
Code coverage
 Animation can be switched off for the SUT. This
allows Rational Rhapsody TestConductor to be used
with tools, such as Rational Test RealTime, in order
to get the Dynamic Code Coverage. With Dynamic
Code Coverage, you are assured there is no unused
code.
110
Failed test
 If a test fails, then a sequence diagram can be
automatically added to the model to help analyze the
problem:
Incorrectly
received
message
Correctly
received
message
Expected
message
111
Advanced Rational Rhapsody
Stopwatch
exercise
112
Stopwatch exercise
 The goal is to build a simple stopwatch that has a
single button and a display. The stopwatch displays
minutes and seconds up to a maximum of 99
minutes and 59 seconds.
 Every time the button is pressed and released within
two seconds, the stopwatch is started/stopped.
 However, if the button is held pressed for longer than
two seconds, then the stopwatch is reset to 0.
113
More details
 Imagine that an ISR (interrupt service
routine) triggers every time that a key is
pressed or released and generates
events evPress or evRelease.
 A colon symbol between the minutes and
the seconds 00:04 should be flashed to
indicate that the Stopwatch is running.
 Build a model of a stopwatch that can be
stopped, started, and reset by injecting
events evPress and evRelease.
114
Advanced Rational Rhapsody
Speed camera
exercise
115
Speed camera exercise
 The goal is to build a Speed Camera System. This system will
have four cameras which will be installed at equal intervals. It
should be easy to change the number of cameras. Each
camera is capable of reading and decoding a number plate of a
vehicle. Whenever a vehicle passes a camera, the number
plate is read and sent to the Speed Camera System.
 The Speed Camera System checks the average speed between
adjacent cameras. If any vehicle takes less than the allowed
time (combination of the speed limit and the distance between
cameras) to pass between two cameras, then it is reported as
speeding.
 After a vehicle passes the last camera, any retained information
should be discarded.
 Assume that every Camera receives the event
evVehicle(aNumberPlate) every time that a vehicle passes.
 The Speed Camera System should print out the number plates
of all detected vehicles that are speeding.
116
Advanced Rational Rhapsody
Useful tips
117
Useful tips 1
 Keep statecharts simple; if they are too complex,
then use sub-statecharts.
 Draw states as small as possible and as close as
possible to other states. This helps during animating,
since they are more readable, especially when there
are several diagrams open at the same time.
 Do not call many actions on a statechart; it makes
the diagram very difficult to read. Instead, call a new
operation that calls the actions.
 To aid navigation within the model, set up
hyperlinks for every use case, class, and package.
118
Useful tips 2
 Look at the Rational Rhapsody samples and revisit
the Cash Register model that you built during this
training. Make sure that you understand these
models before you start a project.
 Do not give the same name to several different
elements of the model, example package and class.
The generated files overwrite each other.
 When working with large projects, it is essential to
divide up the model into components. The
interfaces between these components should be
well-defined. Then, work can be carried out
simultaneously and independently by different
teams on each component.
119
Useful tips 3
 Do not put everything onto a single diagram; this
can make reading the diagram difficult. Using a
couple of diagrams, depicting different views can
really help in communicating the model.
 Use an iterative approach similar to that taken
during this training, constantly model / save /
generate / make / run. Do not wait until the model
is too large before animating.
 Each diagram should have a mission, a reason
why it is there, and should be named in such a way
as to reflect this.
120
Useful naming conventions
 Start Event names with ev:
 For example, evStart
 Start Triggered operation with tg:
 For example, tgPress
 Start Condition operations with is:
These conventions help
when reading diagrams
and when recalling
names of model
elements.
 For example, isPressed()
 Start Interface classes with an I:
 For example, IHardware
 Start Classes with an UpperCase, operations and
attributes with a lowerCase.
 Use an UpperCase to separate concatenated words,
for example, restartSecondTimer().
121
Advanced Rational Rhapsody
Avoiding common
mistakes
122
Dead lock situation 1


123
Dead lock situation 2
124
Transition or reaction in state?
Reactions in state
125
Null transitions
 Each time a state is entered, Rational Rhapsody
checks to see if there is a null transition that could be
taken. If there is, then the transition is taken.
In the following example, there is no stable state since
every state has a null transition with a guard that evaluates
to True.
 In this case, the following message is displayed: Infinite
loop of Null Transitions.
A Null Transition
is a transition that
has no trigger.
126
What is done first?
 When in the waiting state, what happens when the
evCoin event is received?
Answer : The value of coin is tested BEFORE it gets assigned!
127
Attribute access
 Setting the access for an attribute modifies the access
for the accessor and mutator, not for the attribute itself.
Attributes by default are always protected.
128
Generate support request
 Rational Rhapsody includes a special function that
facilitates sending an email to Technical Support.
 This function collects information about your system
and the Rational Rhapsody environment and model,
then creates a zip file.
 This zip file can then be sent to IBM.
 Alternatively, the zip file can be transferred to another
machine and emailed.
129
Support request
Quickly collects problem
information
Information about
Rational Rhapsody and
system automatically
collected
130
Adding files, screen shots, videos, and so on
Videos can be
captured to aid
problem description
Model and extra files
can be quickly added
Screen shots
can be
captured
131
Sending the email
 All models, files, and screen shots are automatically
zipped and attached.
132
eLearning
 eLearning is Web-based, self-paced training.
 Interactive multi-media
features:
Demonstrations
You try it exercises
In lesson quizzes with feedback
Post tests to ensure knowledge has been acquired
 Intended as an introduction to:
Modeling languages
Advanced topics
Add-on products
133
eLearning: Current Courses
 For a listing of all courses offered, visit us at:
http://www.ibm.com/training
134
Recommended Reading
135
Summary
 You should now know enough about Rational
Rhapsody to start creating your own projects. You
should have basic familiarity with the following topics:
The Rational Rhapsody Framework
Generating reports
Using the API
Using Configuration Management
Rational Rhapsody TestConductor
 To develop more in depth skill and knowledge about
the topics above, there is additional Rational
Rhapsody Specialist training available.
 Please fill in the online evaluation form your instructor
guides you to or complete the evaluation at the end of
this manual, good luck and keep in touch.
136
Evaluation Form
Prior to this course, how would you rate your knowledge of the following?
UML
C++
______
____
How would you rate the following aspects of the course?
Overall course
Organization of topics
Usefulness of topics
Usefulness of labs / exercises
Course materials
______
______
______
______
____
How would you rate the instructor in terms of the following?
Overall effectiveness
Knowledge of subject
Stimulated and held interest
Organizational skills
Provided ample time for questions
Addressed questions well
Gave clear instructions for labs, etc.
______
______
______
______
______
______
_______
137
5 = Excellent
0 = Poor
Name (optional) :
Company :
Date :
Instructor :
Were there any topics which seemed difficult to understand?
Are there any topics, which were not covered, that you feel should be?
Do you have any suggestions for improving the course and/or the course materials?
What was most effective about the instructor’s presentation?
Do you have any suggestions for improving the instructor’s presentation?
Do you feel that the course has met its objective?
Would you recommend this course to a colleague?
Please provide their details, if we may contact them:
138
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising