UML Start-Up Training Basics in Rhapsody

Similar documents
ReqXChanger Closing the Gap between Requirements and Modelling

Practice Fusion API Client Installation Guide for Windows

UML - Getting Started EA v4.0

Business Process Management IBM Business Process Manager V7.5

Hypercosm. Studio.

Model Simulation in Rational Software Architect: Business Process Simulation

Jump-Start Tutorial For ProcessModel

Back-up Server DOC-OEMSPP-S/2014-BUS-EN-10/12/13

DWGSee Professional User Guide

AutoDWG DWGSee DWG Viewer. DWGSee User Guide

Inteset Secure Lockdown ver. 2.0

IT Quick Reference Guides Using Windows 7

USER GUIDE Version 2.0

Using your Bluetooth laptop with the Logitech wireless hub

WebSphere Business Monitor V6.2 Business space dashboards

Module 1: Getting Started With Altium Designer

1. Tutorial Overview

Content Author's Reference and Cookbook

Integrating Legacy Code / Models with Model Based Development Using Rhapsody

Outlook . Step 1: Open and Configure Outlook

Manual English KOI Desktop App 2.0.x

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

PTC Integrity Eclipse and IBM Rational Development Platform Guide

Password Protection Application for Verbatim USB Flash Drives

TUTORIAL 4 Building a Navigation Bar with Fireworks

TestManager Administration Guide

You must have at least Editor access to your own mail database to run archiving.

warpct.com Basic Computer Skills MS Windows XP Workbook courseware by WARP! Computer Training

Introduction to LogixPro - Lab

Using Rational Rose to Create Object-Oriented Diagrams

VP-ASP Shopping Cart Quick Start (Free Version) Guide Version 6.50 March

2X ApplicationServer & LoadBalancer Manual

Unified Communications Using Microsoft Office Live Meeting 2007

Personal Call Manager User Guide. BCM Business Communications Manager

Installation Guidelines (MySQL database & Archivists Toolkit client)

Microsoft Access Basics

SIMATIC HMI. WinCC flexible 2008 Getting Started - First-Time Users Getting Started. Printout of the Online Help 06/2008 A5E

Microsoft PowerPoint 2010

Excel 2007 Basic knowledge

Installing LearningBay Enterprise Part 2

How to test and debug an ASP.NET application

Content Author's Reference and Cookbook

Eclipse installation, configuration and operation

Appendix K Introduction to Microsoft Visual C++ 6.0

ASUS WebStorage Client-based for Windows [Advanced] User Manual

Working with SQL Server Integration Services

... connecting the Automotive Aftermarket. TEC-MessageCall. Version 1.0

I ntroduction. Accessing Microsoft PowerPoint. Anatomy of a PowerPoint Window

LDCDP GdW. L force Controls. Ä.GdWä. Software Manual. Industrial PC. WindowsR CE Thin Client. Operating system

Animator V2 for DAZ Studio. Reference Manual

Most of your tasks in Windows XP will involve working with information

Publishing Geoprocessing Services Tutorial

FreeAgent DockStar Network Adapter User Guide

CNC Transfer. Operating Manual

Install MS SQL Server 2012 Express Edition

Building and Using Web Services With JDeveloper 11g

CORSAIR GAMING KEYBOARD SOFTWARE USER MANUAL

Word basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Using the SAS Enterprise Guide (Version 4.2)

NASA Workflow Tool. User Guide. September 29, 2010

Desktop, Web and Mobile Testing Tutorials

14.1. bs^ir^qfkd=obcib`qflk= Ñçê=emI=rkfuI=~åÇ=léÉåsjp=eçëíë

Appendix 1 Install RightNow on your PC

ICS Technology. PADS Viewer Manual. ICS Technology Inc PO Box 4063 Middletown, NJ

ADDING DOCUMENTS TO A PROJECT. Create a a new internal document for the transcript: DOCUMENTS / NEW / NEW TEXT DOCUMENT.

USING STUFFIT DELUXE THE STUFFIT START PAGE CREATING ARCHIVES (COMPRESSED FILES)

Bitrix Site Manager 4.0. Quick Start Guide to Newsletters and Subscriptions

Figure 3.5: Exporting SWF Files

2 SQL in iseries Navigator

Bitrix Site Manager 4.1. User Guide

Vodafone PC SMS (Software version 4.7.1) User Manual

PBA.pro Getting Started

Quick Start Guide. Fundamentals of Systems Modeling Series. Systems Modeling with Enterprise Architect version 9.1. Version 1.

PowerPoint 2013: Basic Skills

Microsoft PowerPoint Exercises 4

Bonita Open Solution. Introduction Tutorial. Version 5.7. Application Development User Guidance Profile: Application Developer

Lab Manual: Using Rational Rose

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

FAQ. How does the new Big Bend Backup (powered by Keepit) work?

KPN SMS mail. Send SMS as fast as !

Microsoft PowerPoint 2011

Browsing and working with your files and folder is easy with Windows 7 s new look Windows Explorer.

WHAT S NEW IN WORD 2010 & HOW TO CUSTOMIZE IT

Creating a Web Service using IBM Rational HATS. For IBM System i (5250) Creating a Web Service using HATS 1

Project management integrated into Outlook

Backup Server DOC-OEMSPP-S/6-BUS-EN

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

Introduction to Microsoft Word 2003

E-Loader Operation Manual

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Introduction to MS WINDOWS XP

Colligo Manager 6.2. Offline Mode - User Guide

Start Active-HDL by double clicking on the Active-HDL Icon (windows).

Tutorial Build a simple IBM Rational Publishing Engine (RPE) template for IBM Rational DOORS

Rx Medical. SMD Utility. Task Scheduler Configuration

You can find the installer for the +Cloud Application on your SanDisk flash drive.

WebSphere Business Monitor V6.2 KPI history and prediction lab

Using Process Monitor

Transcription:

UML Start-Up Training Basics in Rhapsody Index Rhapsody History Product variants Basic modeling Exercise Stopwatch Exercise Dishwasher Exercise Dishwasher System The Tool: IBM Rational Rhapsody Rational Rhapsody, a modeling environment based on UML, Rhapsody is a visual development environment for systems engineers and software developers creating real-time or embedded systems and software. Rational Rhapsody uses graphical models to generate software applications in various languages including C, C++, Ada, Java and C#. History Rhapsody was first released in 1996 by Israeli software company I-Logix Inc. Rhapsody was developed as an object-oriented tool for modeling and executing Statecharts, based on work done by David Harel at the Weizmann Institute of Science. In 2006, I-Logix's shareholders sold the company to Swedish software company Telelogic AB. In 2008, Telelogix AB was acquired by IBM, consequently Rhapsody became a Rational Software product, like all former Telelogic products.

Product variants IBM Rational Rhapsody ist available in different variants: Architect for Systems Engineers Architect for Software Designer for Systems Engineers Developer Design Manager The characteristics of the first 4 variants can (as a thumb rule) be described with the following matrix: SysML modeling Architect for System Engineers model simulation Designer for Systems Engineers UML Architect for Software Developer The Design Manager variant is part of the Jazz family, and will not be discussed here. Target language One of Rhapsody s most valued features is the ability to generate code. There are different target languages possible: C++ C Java C# Ada One needs to decide about the target language before start of a project, consequently Rhapsody starts in language dependent variants, Rhapsody in C++, Rhapsody in C, and so on. They differ a bit, but naturally the differences are related to user defined code inside the model and not to UML model elements. They keep identical in the different variants. Naming conventions Model element names in UML can be constructed using any characters including spaces. But Rhapsody is different in this respect. As rule of thumb use this recommendation: #1: Use the same naming conventions as you use inside the target language. #2: Use spaces only in diagram names. 2 Willert Software Tools

Basics The GUI IBM Rational Rhapsody (from now on named as Rhapsody) allows building up a model inside a workspace. When starting with the model, one has to open or to create a Rhapsody project. The GUI consists of a browser a diagram pane an output pane a drawing toolbox a feature window The browser contains all model elements, this is the full view into the whole model. One can show model elements on diagrams, where they can be understood easier and quicker than inside the browser. Usually they appear in different layouts, depending on their purpose. There are layouts for overviews or layouts for details. Consequently you can place a model element onto several diagrams, each having different context and purpose, some showing details, some not. The drawing toolbox contains all those model elements that can be shown on diagrams. The toolbox is context sensitive, i.e. if the current diagram is a Class Diagram, the model elements of Class Diagrams are inside the box. If the current diagram is a Sequence Diagram, only model elements of Sequence Diagrams are available. The output pane shows messages for different tasks in the tool and is divided in different tabs, e.g. if you start a search a new tab with the search results for your search string is created. The feature window enables you to enter details for model elements, details that cannot be edited inside the symbols on diagrams. The features window is also context sensitive, i.e. it shows the properties of the currently selected model element. The window is a separate one, you can leave it open the whole time you work in Rhapsody. One can also dock it into Rhapsody s main window, just open the context menu of the title bar of the features window and select the option Enable Docking by Drag. Browser Output pane Diagram pane Feature window Drawing toolbox 3 Willert Software Tools

Creation of model elements Model elements can be created directly inside the browser as well as on diagrams or inside the features window. Elements that already exist can be shown on diagrams with the usage of drag&drop from the browser. Create inside browser: Select an entry in the model browser, open the context menu with the right mouse and select Add New then the appropriate model element. Create inside diagram: Click on the symbol in the toolbox and click into the diagram. Being in Select Mode : you can create only one model element. Being in Stamp Mode : every new click in the diagram creates a model element until you deactivate Stamp Mode. Renaming of model elements Model elements can be renamed anywhere in the browser or on a diagram. If a name is changed all references to the definition will be updated automatically through the whole model. Deleting model elements There are 2 different ways to get rid of model elements: remove from a diagram and delete from the model. The first variant removes only one symbol from one diagram, all other references stay at the place they have. The second variant deletes the model element from the browser and all references from all diagrams and the browser as well. Rules of thumb: #3: Whenever you want to delete a model element totally from your model, select it inside the browser and use the Del key. #4: If you deleted something and the tool did not ask you whether the deletion should take place, you removed the symbol only from the diagram and not from the model. 4 Willert Software Tools

Model Browser The Project The upper most entry is the project name. All global project settings are saved here. The appropriate project file in the file system has the name Project.rpy. The Component This is Rhapsody s component. You can have several components, but only one of them is active. Herein you specify what is content of a build process, e.g. which model parts are included, which external libraries, etc.. Also a reverse engineering step should be defined within an own component. The Configuration This defines the kind of a build process, it gives an answer to the question how is the build process done. The configuration of the code generation and the compilation and linking is made here. One can use several configurations inside one component. For example one configuration for a simulation, one for a release. Only one configuration is active. The Object Model Diagram Rhapsody uses own diagrams. An Object Model Diagram (mostly abbreviated with OMD) can be used instead of several UML diagrams, usually for Class-, Object- and Component Diagrams. A default diagram is created automatically below the project, recommended is to show only the package structure at this model level. The Package Here we see the structure of the model. Reminder UML: a package is nothing else but a container for any other model element. Recommended is to not use a name Default. The content of a package is normally stored within an own file in the file system, the name for the Default package is Default.sbs. The Profile A special kind of package. Normally used to store properties or stereotypes. The screenshot shows the official Testing Profile from the OMG. The Category This is an additional concept in Rhapsody to structure the model. Examples for categories in the screenshots are Components, Object Model Diagrams, Packages and Profiles. 5 Willert Software Tools

Modeling in Diagrams A first step is to have a diagram. Select the owner package for the intended diagram in the model browser and create the diagram by using the context menu Add New and the sub-menu Diagrams. Second step is to place symbols onto the diagram using the Drawing toolbox as described previously. Now some details: The Layout Toolbox If you have several objects in different size and different alignments and want to change that, use the layout toolbox. It gets activated only if you have several symbols selected. align top make same size (the last selected symbol is the master) Display Options Some more layout relevant options are managed from the window Display Options ; it gets activated from the context menu of a symbol inside a diagram. One can for example choose, whether the name shall be shown as relative name or as a Full Path, i.e. also the whole structure where the element is located. If you select a class you can also choose whether ports and interfaces of the ports shall be visible, or which compartments shall be shown. The display options are set for one single symbol only. Images If your model or parts of it is intended to be shown to non UML users, you can associate an image to a symbol. Similar to the display options, select one symbol in a diagram and open the context menu. You ll find an entry Associate Image.... Example: 6 Willert Software Tools

The Features Window The features window enables you to enter details for model elements, details that cannot be edited elsewhere in the browser or inside the symbols on diagrams. The features window is context sensitive, i.e. it shows the properties of the currently selected model element. This is the default, but one can pin the window, in that case the window is no longer context sensitive, i.e. it does not change the window content if you select another model element. The window is a separate one, you can leave it open the whole time you work in Rhapsody. One can also dock it into Rhapsody s main window, just open the context menu of the title bar of the features window and select the option Enable Docking by Drag ; then drag it into another Rhapsody window. Example to specify details or create model elements inside the features window, double-click on a class and you see: Now activate the Attributes tab and you are able to create attributes there just by clicking on the New entry. Others Navigation Navigating an element between the browser and the appropriate symbol on diagrams is possible. Try the context menu entry Navigate, then one of the entries in the sub-menu; or use Ctrl-l to locate an element inside the browser. How is the model saved As mentioned earlier, Rhapsody stores all model related information in files in the file system. Per default one file for the project and one directory for all packages and components. The project file has the name <project>.rpy, the folder <project>_rpy, the packages have the suffix.sbs and the components the suffix.cmd. When you create new packages or components, new files are generated as well, this is natural. But if you delete a package or component, the appropriate file is not deleted; take as rule of thumb: Rhapsody does not delete files in the file system. Some more files can be found inside the folder that contains <project>.rpy but they do not contain model elements or diagrams. If you delete them, you do not corrupt the model. Controlled Files Files containing not model elements but pictures, word- or excel data, that are somehow important to a UML model can be included into the project as controlled file. The file has to be stored somewhere below the <project>_rpy folder. The content can not be read from Rhapsody, but Rhapsody invokes the appropriate tool instead. 7 Willert Software Tools

Exercise Here is a small exercise to get familiar with the GUI; create a model that counts down from 10 to 0. The model will contain one class only, but attributes, operations and a state machine diagram are included. When the model is finished it will first run in an animation mode and after that as a Windows executable. Step 1: create a Rhapsody project Use the Windows start menu, and start the Rhapsody Developer, use C++ as language. From the File menu choose New and enter an appropriate windows file folder and the project name. Project type and project setting shouldn t be changed. The tool asks you now for allowance to create a new folder CountDown inside the folder C:\work. Just accept. Get familiar with the model created so far. Which model elements and diagrams are created automatically? Consider: Rhapsody uses an Object Model Diagram as an overall diagram for structural elements. 8 Willert Software Tools

Step 2: create the class with attributes and operations Click on the Class symbol in the drawing box and place it onto the object model diagram, name the class CountDown. Alternatively create a Class Diagram and create the class CountDown there. To implement the behavior we need an attribute ( counter ) two operations ( printnr and printstr ) and a State Machine Diagram. The attributes and the 2 operations should be created by using the features window of the class CountDown. Open it with a double click on the class symbol of CountDown on the diagram or on the model element CountDown in the browser, select the appropriate tabs Attributes / Operations and click on the New entry there. Name the new elements as suggested above. Then select the operation and click on the Invoke Feature Dialog, this opens a second feature window. It should be used to enter argument and implementation for the operations, see screenshot as a suggestion for operation printstr, printnr should have a similar implementation but with a number as argument. 9 Willert Software Tools

Step 3: create a State Machine Diagram Consider: in Rhapsody we use the name Statechart instead. To create that diagram select the class CountDown, a) then either right mouse click to open the context menu, then Add New -> Diagrams -> Statechart, or b) use the Open Statechart button, see screenshot below. Use the Drawing Toolbox to specify now the behavior, pick appropriate symbols in the toolbox and place them onto the diagram. Reminder: to enter details use the features window, it helps also to specify triggers, guards or actions on transition lines. Step 4: create an executable Reminder: classes in UML specify resources, but when we want to get the model running we need to have instances of classes. Create an object of the class CountDown, right click the class inside the browser to open the context menu and choose Make an Object. The object will have a default name itscountdown. Feel free to rename it to a better name. Step 4a: generate code An executable is generated in different steps: first task is done from Rhapsody s code generator, it generates target code, as we chose Rhapsody in C++, we will get CPP and H files. This phase needs to be configured, open the features window of the model element DefaultComponent and figure out which scope is set. Then open the menu Code, then Generate and DefaultConfig. You ll be asked whether Rhapsody may create the target directory...\countdown\defaultcomponent\defaultconfig. Agree, open a file explorer to figure out which files are generated. Step 4b: compile and link Rhapsody does NOT include a compiler, it is expected that a compiler is already installed, ideally the compiler is installed before the Rhapsody installation. In that case a connection between compiler and Rhapsody is installed automatically. If not, interrupt the exercise here and repair the installation. Continuation: As the DefaultComponent in the model specifies only the scope of the code generation, it s also necessary to specify how the compilation is done. Open the features window of the model element DefaultConfiguration below the DefaultComponent, and switch to the tab Settings. Choose the correct compiler in the list box Environment. Afterwards open the Initialization tab and specify the initial instance. 10 Willert Software Tools

Step 5: run the executable Very simple: press the Generate/Make/Run button: The Result: Step 6: simulate the behavior The state machine isn t very complicated, but in normal cases you need to walk manually through the specification, this can be done in Rhapsody s animation mode. Open the features window of the configuration of the code generation (reminder: below the DefaultComponent we have the DefaultConfig ) and choose Animation in the list box Instrumentation Mode. Press the Generate/Make/Run button and wait until the executable starts. Minimize the command box and observe a new toolbox inside Rhapsody s GUI: Press the Go Step button four or five times. If the state machine diagram of the object is not opened automatically, open the Tools menu and choose Animated Statechart : result shall be: Now: Play with the Animation Toolbox 11 Willert Software Tools

Dishwasher The second example gets a bit more complex. Create the state machine of a dishwasher. Use simply the principle of time goes by to simulate the washing, rinsing and drying process, i.e. a timer expires after 10 seconds means the washing is done. Consider that one can usually open and close the door of the machine during the execution phase without causing a stop and restart of the process. Implement also different programs, for example a normal mode and a quick wash mode. Use regions in state machines for this purpose. The following picture of the state machine should be guidance enough: Needed Attributes: washingtime, rinsingtime, dryingtime, cycles Needed Operations: setup(), iswashed(), isrinsed(), isdried() How to differentiate between normal mode and quick mode: The attributes for simulating the duration of the different phases are initialized differently inside the operation setup(). For example, if the state machine is inside state normal the attribute washingtime is set to 8, if it is in the state quick, washingtime is set to 5. Similar to the first example: Create an executable, and run it inside a simulation. 12 Willert Software Tools

Dishwasher System The third example gets a bit more complex. Now we do no longer have a single class, but there is a collaboration of several classes, as this is the case in every normal model. The intention here is to get you familiar with Rhapsody s way to model the collaboration. We will have a class motor with just 2 operations on and off. And a class panel that allows to start and stop the washing, to simulate the opening and closing of dishwasher s door. Access from class dishwasher to class motor is modeled with an association, the communication between panel and dishwasher with ports and interfaces. Here are some hints: A class diagram to define the resources: A composite structure diagram to define the system (including the root class DishwasherBuilder ) An example of the state machine for the class FrontPanel : and the operation processkey(): 13 Willert Software Tools

Dishwasher - Testing with Webify One more good feature of Rhapsody is its ability to execute the model in an advanced mode. The code generator of Rhapsody generates some additional code into the executable to enable the collaboration between a web page and the executable. That allows the user to visualize and modify attributes, or to send events via the web page. Some prerequisites are necessary: Set the stereotype Web Managed to all model elements that should be on the web page: Select Web Enabling in the configuration. Press the button GMR Press the botton GO in the execution toolbox after the executable started Open http://localhost inside a web browser and play with the web page 14 Willert Software Tools

Dishwasher - Testing with Panel Diagram One more good feature of Rhapsody is its ability to execute the model in an advanced mode. The code generator of Rhapsody generates some additional code into the executable to enable the collaboration between the executable and a special diagram: Panel Diagram. See an example: There are a lot of widgets possible inside such a diagram, all of them can be found inside the drawing toolbox of a panel diagram. When you are satisfied with the layout of your diagram, you have to take care of the name of a widget, e.g. Close, use the features window for that the binding to a special model element, use the features window for that. Now: play with the Panel Diagram, once you started the executable and don t forget to press the GO button. 15 Willert Software Tools

Product: IBM RATIONAL RHAPSODY START-UP TRAINING Author: WOLFGANG SONNTAG Editor: WILLERT SOFTWARE TOOLS GMBH Hannoversche Straße 21 DE - 31675 Bückeburg Phone: +49 5722 9678-60 info@willert.de www.willert.de! 16 Willert Software Tools