1st Edition GREG KRILOV, JULIA VASSERMAN, DANIEL HODGIN Rational Rose Software Guide A STUDENTS GUIDE TO Rational Rose Software Table of Contents CH1. User Interface ...................................................................................................................... 1 Contents......................................................................................................................... 1 Getting Started ............................................................................................................ 2 The Rational Rose Application Window ........................................................... 2 The toolbar ................................................................................................................... 4 Browser ......................................................................................................................... 7 Diagram window ........................................................................................................ 7 Specification Window .............................................................................................. 7 Customizing the toolbar .......................................................................................... 8 CH2. Business Requirements Analysis using OO ............................................................. 9 Contents......................................................................................................................... 9 Use-Case Diagram .................................................................................................... 10 Use Cases ..................................................................................................................... 11 Actors ........................................................................................................................... 12 Association ................................................................................................................. 14 Packages ...................................................................................................................... 14 Stakeholder diagrams ............................................................................................ 15 Linking documents to a model ........................................................................... 16 Chapter 3 ....................................................................................................................................... 18 Contents....................................................................................................................... 18 Domain Class Diagram ........................................................................................... 19 Generalizations (Inheritance) ............................................................................. 20 System sequence diagram .................................................................................... 21 Importing/Exporting petal files ......................................................................... 24 Configuring Rose ...................................................................................................... 26 Chapter 4 - Step by step installation guide ..................................................................... 30 Glossary.......................................................................................................................................... 38 Index ................................................................................................................................................ 40 Preface What is Rational Rose? Before you begin reading the guide, it is necessary to have a simple understanding of what exactly this software is about. Rational rose is an object-oriented UML software design tool that is a part of a comprehensive set of tools that deal with best software practices. The software helps improve communication in teams while at the same time reducing development time and greatly increasing software quality. Audience This guide is designed primarily for students in courses which deal with Rational Rose. The guide can also be used by teachers to coordinate classes. Hands on At the end of each section (excluding section one), there is a hands-on section that guides you step by step on the creation and usage of the object discussed. Chapter 1 CH1. User Interface Contents 1. Getting Started – Page 1 2. The Rational Rose Application Window – Page 1 3. The title bar – Page 3 4. The toolbar – Page 4 5. The toolbox – Page 5 6. Browser - - Page 6 7. Diagram window – Page 7 8. Specification Window – Page 7 9. Customizing the toolbar – Page 8 1 Getting Started When you first open up Rational Rose, a “create new model” window pops up, from this model you can load up a model with predefined elements. Press the cancel button as we will not be using any of these templates. Let us begin by explaining the toolbar and its different button functionality The Rational Rose Application Window The application window consists of the title bar, menu, toolbar, browser, documentation, specification, and the diagram window. 2 Title bar Menu Toolbar Browser Documentation Toolbox Diagram Window Specification The title bar The title bar displays the current open models name, a minimize button, a maximize button and a close Rational Rose button. Right clicking on the title bar brings up a Control-Menu box. Restore – restores the window to its original size Move – Highlights the border of the window and allows you to move the window by clicking and dragging the title bar Size – Allows for resizing of the window Minimize – Minimizes the window to the taskbar Maximize – Puts the window into full screen Close – Closes the window 3 The toolbar The toolbar is displayed under the menu bar and is used to perform basic tasks in Rational Rose. Standard Toolbar New Model Click on the icon to start a new model or file to work with. Open Model Clicking the icon would create a new window which allows you to browse for an already created model. Once you select the right model press open and a prompt will pop up asking if you want to save the current model. By selecting “no” the software displays the selected model from the browse window and exits the model that was open previously. By pressing yes the model is saved and discarded and a new selected model is displayed. Save Model Selecting the save model icon would display a new dialog box with prompt for file name and the type of file. To view the model they should be saved under .mdl, once you enter a file name press save or cancel. If the model already contains a name pressing the icon would save the made changes. Cut Using the cut icon will remove selected elements of your model. Copy Clicking the icon will copy selected items which later can be pasted into the model. This icon is used in order to copy elements in the current model or a model in a different location. Paste Pressing on the paste icon will paste elements that were previously copied or cut. Using paste allows users to place already created elements into a different location. Print Diagrams Selecting this item would display a dialog box for printer properties once you set the settings to your preference press ok. This will print the diagrams to the selected printer. 4 Context Sensitive Help This icon provides the user with online information about an icon. Once pressed, a question mark will be placed at the cursor, allowing the user to select an item which they need further description and online help with. Unfortunately this option is not available to students using Rational Rose downloaded from school due to lack of a help file. View Documentation This icon displays the documentation window which allows users to enter text and notes about the model. Browse Class Diagram Clicking on the icon will display a dialog box for selecting a class diagram from the Use Case or Logical Views. Browse Interaction Diagram Clicking on the icon will display a dialog box for selecting a sequence diagram / interaction diagram. Browse Component Diagram Clicking on the icon will display a dialog box for selecting a component. Browse State Machine Clicking on the icon allows users to search inside the Select Statechart Diagram or Activity Diagram dialog box. Browse Deployment Diagram Clicking the icon displays a Deployment Diagram dialog box where user can search for diagrams. Browse Parent Clicking the icon will display the parent model for the selected element. If an element is created in another model it will display that model. Browse Previous Diagram Selecting the item will display a previously viewed model. Zoom In Pressing the icon will magnify the model for better viewing an area of the diagram. Zoom out Pressing the icon will decrease the size of the model for better viewing of the full diagram. 5 Fit in Window Clicking the item displays the model in dimensions that fit into the window. This changes the zoom settings that you may have adjusted previously. Undo Fit in Window Clicking the icon undoes any changes created by the Fit in Window icon. Toolbox The toolbox is made up of tools that are appropriate for the current diagram in the diagram window. Depending on what type of diagram is open, the toolbox will be populated with the proper tools. Along with the diagram specific tools, there are three tools which are the same for everything: the selector, the separator, and the lock icon. In order to customize the toolbox (add more tools) what you have to do is click anywhere inside the toolbox that is not an icon and select the Customize option. Once this is clicked on the Customize Toolbar will come up To add items to the toolbox simply click on an item on the left and press add. 6 Browser The browser window works much like a tree view browser in windows explorer. The browser allows you to Create new folders (packages), actors, use cases, classes, files, URL’s, and diagrams in a hierarchical structure. Each object is represented by a unique icon to show the type of each object. Diagram window The diagram windows are the main form of interaction a user will deal with. Diagram windows are used to visually represent objects and elements of the model. Diagram windows give the user full control over the design, layout, properties, etc of model objects and how those objects interact with each other. Multiple objects can appear on one diagram window and all objects can each appear on multiple diagram windows. Specification Window The specification window allows you to change options dealing with a particular object such as an actor, a relationship, a use case and etc in the diagram window. To open the specification window right click the object and press open specification. 7 Customizing the toolbar By right clicking on the toolbar the user can choose to add or remove additional buttons from the panel. From there you can select toolbar buttons either from the right side or the left side and respectively add or remove them to the toolbar 8 Chapter 2 CH2. Business Requirements Analysis using OO Contents 1. Use-Case Diagram – Page 10 2. Use-Case – Page 11 3. Actors – Page 12 4. Packages – Page 14 5. Stakeholder diagrams – Page 15 6. Linking a document to a model – Page 16 9 Use-Case Diagram A Use Case diagram shows an elevated view of how a specific part of a system or a system as a whole functions and/or is used. Use Case diagrams describe system behavior which is more simply known as use cases. A Use Case diagram can contain the following: Actors – System Users Use Cases – System Behavior / Interaction between an actor and the system Interactions between Actors and Use-cases including associations, dependencies, and generalizations(Refer to chapter 3) Use-cases diagrams are used to show system requirements and to help understand how a system should work. To create a new use case diagram do the following: Right click on Use Case view -> New -> Use Case Diagram 10 Use Cases A use case is a specific way the system interacts with an actor. A single use case is a set of events that can take place between an actor and the system. A use case is initiated by a trigger that is activated by an actor. For example if an actor clicks an update button that would be a condition to activate a use case. Use cases also show: Patterns of behavior of the system, a list of transactions that occur for a given scenario of the use case. Use cases provide a way to gather system requirements, communicate with end users, and test the system. To determine what will make a good use case the designer should consider the actors needs and what the actor will do with the system in order to ensure the system will end up being what the user expects. You can create a new use case in two different ways: Right click use case view -> new -> use case 11 Click on the “oval” shaped toolbox item and click in the diagram Manage Supplies is the use case and Manager is the actor in this figure Actors In Rational Rose the actors in the models symbolize system users. Knowing which actors will be interacting with the software is essential in order to create associations. Moreover, the actors provide the beginning building blocks for the system; how it should be organized and developed. All models in this chapter start with an actor and connect to a use case. It is important to note that an actor cannot change what the use case does, but rather it acts together with the use case to perform the needed tasks. An actor can use the system through input such as for updating or creating new records, or an actor can receive data from the system for example when viewing system’s records. How to determine your actors? Before working on the system as a developer you must brainstorm and decide on who will be the users of your system. Users can be employees, staff, and people that will perform tasks such as insert data or get output from system. Other users can be those who are responsible for maintaining the system and making sure the system works as it should. Anything else that interacts with the system can be represented by an actor such as a database or another system. 12 You can create an Actor in two different ways: Right click Use Case View -> New -> Actor Left Click on the “stick figure” in the toolbox and click anywhere inside the diagram window 13 Association An association is used to signify a connection between use cases and actors. Associations are simply a line in a use case diagram that connects actors to use cases. The line represents a relationship between these two objects. There are two types of associations: unidirectional and bi-directional. In Seneca courses you will deal almost exclusively with unidirectional associations. To create an association line, click on the line to a use case. icon in the toolbox and then click on an actor and drag the Creating an association. Packages A package is a folder like object that can contain other objects in it. Packages allow a hierarchical structure to be created in the model. To create packages do the following: Right click on use case view -> New -> package 14 Stakeholder diagrams Stakeholders: A stakeholder is anyone who is affected by the system. There are five categories of stakeholders: users, sponsors, developers, authorities, and customers. Users: Standard Users Individuals who use the system on a day-to-day basis Those who write queries to retrieve information. Management that uses the system for collecting reports and statistics Executives Non-Human Users Devices that the system interacts with Other systems Sponsors: Individuals who do not interact with the system directly. Example: Business Managers Those who take part in supporting the system financially. Example: Investors -Individuals who are affected by the business outcomes resulting from the system. Developers: Stakeholders who participate in the maintenance and the creation of the system. Authorities: The experts on a certain problem. Customers: The persons involved doing business with the company. How to determine your stakeholders? The questions you might want to ask yourself when modeling the stakeholders are who are the users of the system? Who sponsors the system? Are there standards organizations the system must follow? Who will maintain the system? To create a stakeholder diagram first create a Use Case Diagram by selecting Use Case View, New, and Use Case Diagram. Then, create a use case by clicking Use Case View, New, and selecting Use Case. Name the use case “System” to represent the new system you will be developing. From the browser window, drag and drop all the stakeholder actors and associate them with the system using the association tool from the toolbox. The association should be made by starting with the actor and dragging the mouse to the system, resulting in a line which connects the two objects. 15 This is a stakeholder diagram showing a system and all the actors associated with it Linking documents to a model At some point in time, you may wish to link an object to an external documentation source such as project plans or a requirements document. Rose provides the option of linking a file or an external website page to an object in your model. In order to create a link to a file or an external website page right click on the object, click on new and then either file or URL. If you select file, rose will allow you to browse your local directories and select a file 16 If you select URL, you will be required to enter the URL to the external website page directly below the object. 17 Chapter 3 Chapter 3 Contents 1. Domain Class Diagram – Page 19 2. Generalization (Inheritance) – Page 20 3. Sequence Diagram – Page – Page 21 4. Importing and Exporting - Page 24 5. Configuring Rose – Page 26 18 Domain Class Diagram Domain Class diagrams capture the logical architecture of the system. The logical architecture of the system describes the relationships between classes which in turn represent key abstractions. A class diagram is essentially a picture which describes a part of a system, it includes associations and attributes. It is made up of icons representing classes, actors, the relationships between them, and may include any of the following: classes, interfaces, associations/relationship, inheritance, aggregation, and composition. Types of classes: Conceptual Classes: A real world concept or thing such as a student or the student’s student number. Software Classes: Things having to do with software such as a function, a screen showing a list, or a database. Associations are relationships between classes which indicate a connection between the two; for example, a veterinarian who can have appointments. Example of a partial domain class diagram Classes are made up of attributes which are data values which make up the class. As seen in the example, a veterinarian is associated with an appointment. The numbers 1 and 0..* and 1 represent multiplicity. Multiplicity indicates how many instances of a class can be are associated with which means 0 or more, 1..*, or n which means anything. In this example we have 0..* appointments for 1 veterinarian meaning that a veterinarian can have anywhere from 0 to many appointments. The appointment class in the example is also connected to a time slot class which is in turn connected to a veterinary schedule. It can be seen that there are one or more timeslots, and the timeslots can have zero or more appointments taking place. Furthermore, a veterinary schedule can 19 have zero or more timeslots meaning that a veterinarian does not necessarily have appointments on every day. Notice the line connecting appointment to timeslot, the end pointing at the timeslot has a black diamond. This means that this is a composition relationship which is a special type of an aggregation relationship. Before composition can be explained, you need to understand what an aggregation relationship is. An aggregation relationship is a particular type of an association; it indicates a whole/part relationship meaning that one class is made up of another. Keeping this in mind a composition relationship is one where if the “whole” class is deleted, all its “parts” get deleted too because they are dependent on its existence. In the above example a timeslot is made up of appointments, meaning that if a timeslot disappears then all appointments attached to it disappear too. How to know if something in a class or an attribute? If the material in question cannot be represented as a number or text, then it is a class, not an attribute. Generalizations (Inheritance) There will be a point in time when you will have a number of classes and realize that they have all a few common attributes. It is inefficient to have repeating attributes and consequently something must be done to remove these redundancies. For this purpose we can implement inheritance in our class diagram by creating a parent class and associating it with its children using a generalization relationship. A generalization relationship is a relationship used to show inheritance between a general type class such as “student” and a more specific class such as “BTS430 Student”. The general class would consist of repeating attributes such as name, student id, GPA, while the specific class would contain attributes which are class specific and apply to only it. There are also many cases where several specific classes are empty with no attributes and are attached to a general class which contains the data. Such a relationship could be between a general “User” class which could have such attributes as name and permissions and the many users of a system which could be “Member”, “Guest”, “Administrator”, etc. A generalization relationship is represented by a solid line going from the specific class to the general class and has an empty triangle at the tip pointing towards the general class. To create a generalization relationship click on its icon in the toolbox, click on the specific class, and drag it towards the general parent class. 20 System sequence diagram The system sequence diagram displays the events that occur when an actor interacts with the system. SSDs are based on use case specifications. Every separate use case scenario should contain a system sequence diagram that displays the input and output procedures. Scenarios include step by step procedures by which SSDs follow. How to begin a System Sequence Diagram: 1. Right click on the package you are working with and select New and then Sequence Diagram. 2. Drag in an actor from the browser window and the system class. The actor should be the specific user that interacts with the system at current scenario, refer to figure 4-1 for an example. System is a class which you need to create to show the message between the actor and the system. Figure 4-1 In this example the Vets interact with the system. 21 3. Looks at the scenario and the initial state the system is in. If the actor is first to interact with the system, select the object message from the toolbox. Drag the object message from the actor to the system. Right click on the line created and select object specifications or double click on the line. A dialog window should pop up; refer to Figure 4-2. Enter a name for a method the system will be using. Note: if input goes into the system the methods should start with an action verb. Inside you can enter parameters for what is being passed to the system. For example enterCustomer(name). Figure 4-1 Right click to select Open Specification. 4. To display system output select message object from the toolbox and drag the mouse from the System class to the actor. Double click on the line and enter what will be retrieved from the system. Note: do not use action verbs when sending back data but simply enter the output. Example: the system can return a name. 5. You can right click on the output message object and select Format then Line Color. A dialog box should appear containing shades of colors, select a shade of blue or a color different from the input message in order to improve viewing and understating of the diagram. 22 6. When a certain task is being done more than once, for example if you’re entering several items into the system you might want to create a loop. To do this, select the Note icon from the toolbox then select the Anchor Note to Item icon and drag a line from the beginning of the task to the note and another line from the end of the task to the note. When finished enter an appropriate name for the loop. 23 Importing/Exporting petal files Importing and exporting files: When working as a team you will need to combine work together and organize group member’s models into packages. Since each team member will be giving a business area to focus on, each individual will have to export their business area package to a Petal file and then import the Petal file into the group model. Exporting package to a petal file: The first thing you would want to do is create a backup file to your Rational Rose model. In case any problems during the exporting process should occur, you will still have a backup file to work with. If you haven’t already done so you should create a package and title it the same as your business area. Inside the package you should place all your models and actors. There are two ways of exporting through the Use Case View or the Logical View diagram. To Export Using Use Case View: Before you start make sure you are not using the Main use case diagram in the Use Case View. Use Case view contains a main, therefore, if you’ve create a model using the main diagram simply create a new use case diagram and place your model there. Your Main use case diagram should be empty in order to complete the instructions. Open the Main use case diagram places in Use Case View by double clicking on it. -Drag your created package entitled the same as your business area into the open main diagram window on the right. You can drag it by selecting the package and moving the cursor to the open window. -Select the package displayed in the main diagram. If you don’t select it you will not be able to perform the export successfully. View Figure -From the Rational Rose bar select File, a dropdown menu should appear. If you’ve followed the instructions correctly you should see Export and then the name of your package or business area, click on the option. For example, if your package name is MaintainaRecord you should see Export MaintainaRecord. A window will pop up asking to name your Petal file. For better organization and clarity name the Petal file the same as your business area. Your file should have a .ptl extension, e.g. MaintainaRecord.ptl. When you’re done naming the file press save. -Exit the model. Do not save the model. If there were any changes that you had to save remember that they were saved when you created the backup Rational Rose file. To Export Using Logical View: -Follow the exact same instruction as for Use Case diagram but instead of a use case diagram place it in a Class diagram. Note that the Main is a Main class diagram. 24 Figure Selecting the package in the main use case diagram will allow you to export Petal files. Importing the Petal Files: Since you will be working with the team model make sure you create a backup before importing any files. You wouldn’t want your team members’ hard work to be changed or corrupted. Open the team model. Follow the steps for every petal file you want to import: Click on the Use Case View in the browser window From the top Rational Rose bar select File and from the dropdown menu select import. A window will pop up that will allow you to browse for the file you want to import. Select the .ptl file you are looking for. Once Rational Rose imports the file check for the location of where it is placed. Sometimes it imports the file into Logical View. Expand the package and if you find it there, you can simply move it by dragging the imported file to the desired location. The package might also be found in the Logical View Main class diagram, you can select the package and delete it from the window since you won’t be using it there. The last step is to save the model with the imported petals in your team model. 25 Configuring Rose Configuring the Rose software Knowing how to configure Rose properly is something every student will need to be able to do. This section will show you how to navigate through the myriad of options and will explain the ones that are of importance to you. From the menu choose tools and then options The options window contains options that are grouped into tabs and boxes. The General tab contains options related to saving, default fonts and colors, layout options, as well as a few misc options. The Diagram tab contains options for compartments, display, message signatures, the grid, and misc. The Browser tab holds options for stereotype names and docking. The Notation tab has notation display, default language and a few misc options. The Toolbars tab has options for the standard toolbar, diagram toolbar, and customized toolbars. The remaining tabs are beyond the scope of this user guide and are not applicable to students at this time. The following is a listing of options that apply to students and descriptions on their purpose within Rose. 26 Save Create backup file – Creates a backup file rose is in use with the extension ~mdl in case of a crash or accidental deletion. Auto save every – This allows you to automatically save the model by the number of minutes specified. Default Font/Color These options simply allow you to set a default font, font size, and color for the software. Layout options Spacing between shapes – this just controls the spacing that is applied when shapes are placed near each other. 27 Display Sequence numbering – for system sequence diagrams and sequence diagrams you will want this option turned off to avoid numbering each process. Focus of control – for system sequence diagrams and sequence diagrams you will want this turned off as well. This option adds a rectangular box to each point on the diagram where object messages and return messages connect to classes. 28 Standard toolbar Show standard toolbar – displays the standard toolbar along the top of the screen just under the menu. Use large buttons – this option will increase the size of the toolbar buttons. Diagram toolbar Show diagram toolbar – this option controls if the toolbox is displayed. Use large buttons – increases the size of the icons displayed on the toolbox. Customize toolbars This block of options allows you to control what icons each toolbox panel displays for each type of diagram available. 29 Chapter 4 Chapter 4 - Step by step installation guide For students who wish to install Rational rose on their own Pc’s or laptop’s we are providing this step by step instruction guide Step 1: Insert the CD and the install will begin automatically. The following screen will appear Step 2: Select “Install IBM Rational Rose Enterprise Edition”. 30 Step 3: Choose Next and then pick “Desktop installation from CD image”. Step 4: Choose Next to begin installation. 31 Step 5: Choose Next after reading the warnings. Step 6: Choose Accept after reading the Software License Agreement. 32 Step 7: Select a location to install the software to or use the default location provided. Step 8: Select which features to install. For our purposes leave everything selected and press Next. 33 Step 9: Choose Install to begin installation. Step 10: Wait for the installation to complete. 34 Step 11: Select “Point to a Rational License Server to get my licenses” and click Next. Step 12: Enter “acstechsy.senecac.on.ca” for the Server Name and click Show Licenses. 35 Step 13: The Seneca ACS License server will show up. Press the close button to continue Step 14: Choose Finish to complete the installation. 36 Addition information: If you encounter the following dialog it is usually due to Rational Rose not being able to connect to the ACS license server. You will get a 3-5 day grace period to use Rational Rose and then the software will no longer work. At the time of this writing you must be connected to the college network to access the license server. Simply opening the software while connected to the college network will refresh the license and allow you to continue using the software. 37 Glossary Actor- an actor is someone that interacts with the system. Actors cannot change what the use case does but rather act together with system to perform the needed tasks. Application window – The main Rational Rose window which is the default upon opening up the software. The application window consists of the title bar, menu, toolbar, browser, documentation, specification, and the diagram window. Browser – The browser is a window on the top left area of the user interface which represents the folder hierarchy of the model. It shows a tree view display of packages, actors, use case diagrams, sequence diagrams, domain class diagrams, classes, class diagrams, files, and URL’s. Diagram window – The diagram window is the area on the right of the screen which shows graphical representations of objects in the model. The diagram windows are used to display diagrams such as use case, stakeholder, sequence, and domain class diagrams. The diagram window allows interaction and configuration of almost any type of object in a model. Domain class diagram – A diagram which captures the logical architecture of the system which in turn describes the relationships between classes which represent key abstractions. Could be thought of as a picture that describes a part of a system. Generalization relationship – A relationship used to show inheritance between a general type class such as “student” and a more specific class such as “BTS430 Student”. Menu – An application window control which contains and provides a user with a list of options having to do with every aspect of Rational Rose. Package- wraps together models and objects in a file for organizational use. PTL file – Rose model file type. (A rose has petals) System Sequence Diagram – A diagram which displays the events that occur when an actor interacts with the system. Specification – The specification window is available by right clicking on an object and selecting the specification option. The specification window allows various options for an object to be modified. Stakeholder Diagram- is an individual who is affected by the system. Types of stakeholders are users, sponsors, developers, authorities, and customers. Title bar – The part of the application window which displays the current files name and extension, the title bar can also be used to minimize, maximize, and close Rational Rose. Toolbar – An application window control which contains shortcuts to many of the Rational Rose action and objects. The toolbar can be customized to satisfy a user’s needs. 38 Toolbox – The toolbox is the area between the browser window and the diagram window which holds buttons to manipulate the objects in the active diagram window. The toolbox icons dynamically update depending on which diagram window type is active. Use Case - is an object that is initiated by the actor. Use cases provide a way to gather system requirements, communicate with end users, and test the system. Use case diagram- The use case diagram displays how the system functions or used by the actor. A use case diagram is made up of an actor, use cases and associations. 39 Index Application Window – Page 1 Actor - 12 Browser - 6 Customizing the toolbar – 8 Diagram window – 7 Domain Class Diagram – 19 Generalization (Inheritance) – 20 Importing and Exporting - 22 Linking a document to a model – 16 Packages – 14 Sequence Diagram – 21 Specification Window – 7 Stakeholder diagrams – Page 15 The title bar – 3 The toolbar – 4 The toolbox – 5 Use-Case – 11 Use-Case Diagram – 10 40