This Script Will Allow You to Test Drive Rational Rose 4

This Script Will Allow You to Test Drive Rational Rose 4

Text / Rational Rose Enterprise Steps
When you start Rational Rose Enterprise you will notice that there are four views that make up a Rose model – the Use Case View, the Logical View, the Component View and the Deployment View.
We will start by creating the Main Use Case Diagram in the Use Case View of the model. / 1.Click the + next to the Use Case View in the Browser to expand the view.
2.Double-click on the diagram called Main.
A Use Case Diagram consists of actors, use cases and the relationships between them. The first step is to identify the actors where an actor is someone or some thing that interacts with the system under development. For our problem we have identified 4 actors – the Student, the Professor, the Registrar and the Billing System / 1.Click to select the actor icon from the tool bar (stickman).
2.Click on the diagram to place the actor.
3.While the actor is still selected, enter the name Student.
4.Repeat the above steps for the other three actors.
Next, use cases for each of the actors are identified. A use case is a piece of functionality that is provided by the system. In our model, the Student wants to Register for Courses. The Billing System receives registration information. The Professor wants to Request a Course Roster. Finally, the Registrar must Manage the Curriculum. / 1.Click to select the use case icon from the toolbar (oval).
2.Click on the diagram to place the use case.
3.While the use case is still selected, enter the name Register for Courses.
4.Repeat the above steps for the other use cases.
Text / Rational Rose Enterprise Steps
Relationships are drawn between the actors and the use cases. A uni-directional arrow is used to show the direction of the communication (who initiates the communication). In the Course Registration system, the Student initiates the Register for Courses use case, which in turn communicates, with the Billing System. The Professor initiates the Request a Course Roster use case. The Registrar initiates the Manage Curriculum use case. / 1.Click to select the uni-directional association icon from the toolbar (solid line with arrow).
2.Click on the Student actor and drag the line to the Register for Courses use cases.
3.Click to select the uni-directional association icon from the toolbar.
4.Click on the Register for Courses use case and drag the association line to the Billing System actor.
5.Repeat the above steps for the other relationships.
6.
A Sequence Diagram is a realization of a use case. It is typically one path through the flow of events for the use case. Sequence diagrams contain objects and messages between the objects that show how the behavior is realized. We will look at adding Math 101 (a Course) for Joe (a Student actor).Text / 1.Click-right on the Register for Courses use case in the Browser to make the short cut menu visible.
2.Select the New:Sequence Diagram menu choice. This will add a sequence diagram called New Diagram to the browser.
3.While the new diagram is still selected, enter the name Add a Course.
1.4.Double-click on the new sequence diagram to open the diagram.Rational Rose Enterprise Steps
Since this sequence diagram is started by the Student actor named Joe, the actor must be added to the diagram. / 1.Click to select the Student actor from the browser and drag it onto the sequence diagram.
2.While the actor is still selected, enter Joe (the name of the actor).
The next step is to identify the objects that must interact to carry out the identified behavior. Here we have the following objects: Registration Form, the manager, math 101, and section 1. / 1.Click to select the object icon from the toolbar (rectangle).
2.Click on the sequence diagram to place the object.
3.While the object is still selected enter the name Registration Form.
4.Repeat the above steps for the other identified objects.
Messages are added to the sequence diagram to show the behavior needed to carry out the identified functionality. In our model:
The student fills out the information on the Registration Form and submits the form.
The form tells the manager that it needs to add a course called Math 101 for Joe.
The manager tells math 101 to add Joe.
Math 101 asks section 1 if it is accepting students (in this scenario, the answer is yes).
Math 101 tells section 1 to add Joe. / 1.Click to select object message icon from the toolbar (arrow).
2.Click on the dashed line for the Student actor and drag the arrow to the dashed line for the Registration Form.
3.While the arrow is still selected, enter the following message: fill in information.
4.Repeat the above steps for:
Student to Registration Form: submit
Registration Form to manager:
add course(joe, math 101)
manager to math 101: add (joe)
math 101 to section 1: accepting students ?
math 101 to section 1: add (joe)

Text

/ Rational Rose Enterprise Steps
Sequence diagrams are used to find the objects needed in the system. Since there are many objects in any system, they are grouped into classes. A class is a collection of objects with the same structure, the same behavior, the same relationships and the same meaning. Classes are contained in the Logical View of the model and shown on Class diagrams. / 1.Click the + next to the Logical View in the browser to expand the view.
2.Double-click on the diagram called Main.
Based on the information in our sequence diagram we can identify the following classes: RegistrationForm, Manager, Course, CourseOffering and StudentInformation. / 1.Click to select the class icon from the toolbar (compartmented rectangle).
2.Click on the class diagram to place the class.
3.While the class is still selected, enter RegistrationForm.
4.Repeat the above steps for the other identified classes.
As a class is created, it should be documented. The documentation should state why the class is part of the model. The documentation for a class is contained in the Documentation window. / 1.If the documentation window is not visible, select the View:Documentation Window menu choice to make the window visible.
2.Click to select the CourseOffering class and enter the following documentation: an offering by the university for a given semester.
In our model, if more sequence diagrams were created you would find a ProfessorInformation class, a BillingSystem class and possibly a ScheduleAlgorithm class. / 1.Add these classes to the class diagram.
The structure of a class is represented by its set of attributes. / 1.Right-click on the CourseOffering class in the Browser to make the shortcut menu visible.
2.Select the New:Attribute menu choice. This will add an attribute called name to the class.
3.While the new attribute is still selected, enter its name -- location.
4.Repeat the above process and add the following attributes:
5.StudentInformation class: name, major
6.ProfessorInformation class: name, department.
Text / Rational Rose Enterprise Steps
The behavior of a class is represented by its set of operations. / Although behavior may be added to a class on the logical view it is typically added via a sequence diagram since these diagrams depict what behavior an object should have.
  1. Click the + next to the Use Case View in the browser to expand the view.
  1. Click the + next to the Register for Courses use case to expand the use case.
  1. Double-click on the Add a Course sequence diagram to open the diagram.
  1. Click to select the CourseOffering class in the Logical View of the browser and drag the class on the section 1 object. This assigns the object to the class.
  1. Right-click on the accepting students ? message to make the shortcut menu visible.
  1. Select the <new operation> menu choice to make the Operation Specification visible.
  1. Enter the name of the new operation: open.
  1. Click the OK button to close the specification.
  1. Right-click on the accepting students ? message to make the shortcut menu visible.
  1. Select the open operation to map the message to the newly created operation.
  1. When you expand the CourseOffering class in the browser by clicking the + next to the class in the browser, you will notice that the operation is added to the class.

The structure and/or behavior of a class may be displayed on a class diagram. /
  1. Click right on the CourseOffering class in the Logical View/Main Class diagram to make the shortcut menu visible.
  1. Select the Options: Show All Attributes menu command.
  1. Click-right on the CourseOffering class to make the shortcut menu visible.
  1. Select the Options: Show All Operations menu command.

Relationships between classes allow the objects in the classes to communicate. Four common types of relationships are association, aggregation, dependency and generalization. / 1. Save your model to CourseRegistration.mdl
Text / Rational Rose Enterprise Steps
An association is a bi-directional structural connection between classes. An association is shown as a line connecting the related classes.
The association between the RegistrationForm class to the Manager class means that objects in the RegistrationForm class know objects in the Manager class and vice versa. /
  1. Double click on the Main class diagram in the Logical view to open the diagram.
  2. Click to select the association icon from the toolbar (line).
  1. Click on the RegistrationForm class and drag the association line to the Manager class.
  1. Repeat the above steps for the following relationships:
Manager and Course,
Manager and BillingSystem,
CourseOffering and StudentInformation, and
CourseOffering and ProfessorInformation.
An aggregation is a stronger form of an association – it is a relationship between a whole and its parts. An aggregation is shown as a line with a diamond next to the class representing the whole.
This is read as: A Course contains or has CourseOfferings. /
  1. Click to select the aggregation icon from the toolbar (line with a diamond).
  1. Click to select the class representing the part – CourseOffering.
3.Drag the aggregation line to the class representing the whole – Course.
A dependency relationships is a client supplier relationship where the client needs the services of the supplier but the client does not know the supplier – something else in the system tells the client to use the supplier. This type of relationship is shown as a dashed arrow pointing from the client to the supplier.
This is read as: A Manager uses a ScheduleAlgorithm. / 1.Click to select the dependency relationship from the toolbar (dashed arrow).
2.Click on the class representing the client – Manager.
3.Drag the dependency relationship to the class representing the supplier – ScheduleAlgorithm.
4.
You will notice that both the ProfessorInformation class and the StudentInformation class deal with information about registration system users. They also have the attribute called name in common. Here, generalization may be used to create a superclass called Registration user to hold the common structure and behavior. /
  1. Add the superclass (RegistrationUser) to the class diagram.
  1. Click to select the generalization icon from the toolbar (line with a hollow triangle).
  1. Click on the subclass – StudentInformation.
  1. Drag the generalization line to the super class – RegistrationUser.
  2. Repeat steps 2 – 4 for the ProfessorInformation class.

As superclass/subclass relationships are created, common structure/behavior is moved to the superclass. /
  1. Click the + next to the StudentInformation class in the browser to expand the class.
  1. Click to select the name attribute.
  1. Drag the name attribute to the RegistrationUser class.
  1. Click the + next to the ProfessorInformation class in the browser to expand the class.
  1. Right-click to select the name attribute and make the shortcut menu visible.
6.Select the Delete menu command.
Text / Rational Rose Enterprise Steps
The UML has a concept called a stereotype which allows the user to extend the UML notation to add meaning for the application. Some common stereotypes for classes are interface, entity, and control. / 1.Double click on the BillingSystem class to make the Specification visible.
2.Click the arrow in the Stereotype field to make the drop down menu visible.
3.Select Interface.
4.Click the OK button to close the specification.
You can also create your own stereotypes – you do not have to use only the pre-defined ones.
Next, design details are added to the classes. Things like association navigation,
Data types for attributes and operation signatures. /
  1. Right click on the aggregation line near the diamond head to make the shortcut menu visible.
  2. Select the Navigation menu command to turn off navigation. This will add an arrow near the CourseOffering class. This implies that the
    Course can talk to the CourseOffering but the CourseOffering cannot talk to the Course.
  3. Double click on the CourseOffering class to make the Specification visible.
  4. Select the Attributes tab.
  5. Enter the data type for the location attribute (char*).
  6. Select the Operations tab.
  7. Enter the Return class for the open operation (int).
  8. Click the OK button to close the Specification.

The next diagram supported by Rational Rose Enterprise is the Component diagram. Here, you can visualize the various components in your system. You can assign classes to a component /
  1. Click the + next to the Component View in the browser to expand the view.
  2. Double click on the diagram called Main.

A component may be a source code component, a library component or an executable component.
Dependencies between the components are shown with a dashed arrow. /
  1. Click to select the component icon from the toolbar (
  2. Click on the diagram to place the component.
  3. While the new component is still selected, enter its name (registration.exe).
  4. Click to select the component icon from the toolbar.
  5. Click on the diagram to place the component.
  6. While the new component is still selected, enter its name (courses.dllCourseOffering).
  7. Click to select the component icon from the toolbar.
  8. Click on the diagram to place the component.
7.While the new component is still selected, enter its name (BillingSystem).Click the dependency relationship icon on the toolbar.
8.Click on the registration.exe component and drag the relationship to courses.dll component.
9.This implies that the registration.exe component depends upon or uses courses.dll.
Text / Rational Rose Enterprise Steps
Once the components are created, the classes in the logical view are assigned to the components. / 1.Double-click on the CourseOffering component to make the Specification visible.
2.Select the Realizes tab. You will see a list of classes in the model.
3.Right-click on the CourseOffering class to assign the class to the component.
4.Double click on the BillingSystem component to make the Specification visible.
5.Select the Realizes tab.
6.Right-click on the BillingSystem interface class to assign the class to the component. You will notice that a circle called BillingSystem is added to the BillingSystem component. This is the UML notation for an interface.
The next step is to add dependencies between the components which are shown as dashed arrows. / 1.Click to select the dependency relationship icon from the toolbar.
2.Click on the Registration.exe component and drag the arrow to the CourseOffering components.
3.Click to select the dependency relationship icon from the toolbar.
4.Click on the Registration.exe component and drag the arrow to the BillingSystem interface (circle).
Next we will set the language for each component. / 1.Double-click on the CourseOffering component to make the Specification visible.
2.Click on the arrow in the Language field to make the drop down menu visible.
2.3.Select C++.
4.Set the Stereotype to be Subprogram Spec, since you intend to generate code for it.
5.Double-click on the BillingSystem component to make the Specification visible.
6.Click on the arrow in the Language field to make the drop down menu visible.
7.Select Java.
Code generation is done using the menusTools menu. /
  1. Select the class CourseOffering component.
  2. Run the commandSelect the Tools:C++: Code Ggeneration menu command.
  3. When the code is generated select the Tools:C++:Browse Hheader menu command to view the code.

Next we will generate the Java code. / 1.Select the BillingSystem component.
2.Select the Tools:Java:Generate Java menu command.
3.When the code is generated select the Tools:Java:Browse Java Source menu command to view the code.
Text / Rational Rose Enterprise Steps
You have done your analysis and design and generated the code and are implementing the methods when you realize that you forgot an attribute. The attribute is added directly to the code. /
  1. Add the attribute salary with a data type of double to the code for the CourseOffering class