1 rose class

17
Introduction Introduction to Rational to Rational Rose Rose General guidelines and General guidelines and Class diagrams Class diagrams

Upload: guna-sekar

Post on 08-Nov-2014

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Rose Class

Introduction Introduction to Rational to Rational

RoseRoseGeneral guidelines and Class General guidelines and Class

diagramsdiagrams

Page 2: 1 Rose Class

Rational RoseRational Rose A specialized tool for drawing UML A specialized tool for drawing UML

diagrams and managing a project’s diagrams and managing a project’s design.design.

Considered industry standard.Considered industry standard. Has many specialized modules and Has many specialized modules and

editions.editions. Code generationCode generation Real-time analysisReal-time analysis ……

In this course it will serve mainly as a In this course it will serve mainly as a specialized drawing toolspecialized drawing tool

Page 3: 1 Rose Class

Rose workspaceRose workspace

Documentation

Projecttree view

Main toolbar

Diagram

Dynamic toolbar

Page 4: 1 Rose Class

The project treeThe project tree Use case viewUse case view

Used for analysisUsed for analysis Contains UC diag., actors.Contains UC diag., actors.

Logical viewLogical view Used for designUsed for design Contains packages, classes, Contains packages, classes,

assoc.assoc. Class, sequence and similar Class, sequence and similar

diag.diag. Component & Deployment Component & Deployment

viewview Used for components design Used for components design

and final deployment diagramsand final deployment diagrams

Page 5: 1 Rose Class

The project tree - usageThe project tree - usage Double-click on an item to Double-click on an item to

open its specification.open its specification. Right-click on an item to Right-click on an item to

add a diagram or sub-add a diagram or sub-items.items.

Most items can be Most items can be dragged and dropped into dragged and dropped into a diagram to create an a diagram to create an instance.instance.

If an item is modified, the If an item is modified, the change is reflected in the change is reflected in the entire project.entire project.

Page 6: 1 Rose Class

The logical viewThe logical view

Contains the project’s Contains the project’s packages, classes, interfaces packages, classes, interfaces and associations.and associations.

Classes and interfaces Classes and interfaces contains their fields and contains their fields and methods.methods.

Classes are drag-and-drop-Classes are drag-and-drop-able into diagrams to create able into diagrams to create instances.instances.

If a class is modified in one If a class is modified in one place, the change is reflected place, the change is reflected to the whole project.to the whole project.

Page 7: 1 Rose Class

The class diagramThe class diagram

Page 8: 1 Rose Class

Class diagram toolbarClass diagram toolbar1.1. Select itemsSelect items2.2. Add textAdd text3.3. Add noteAdd note4.4. Bind note to itemBind note to item5.5. Create new classCreate new class6.6. Create new interfaceCreate new interface7.7. Draw new associationDraw new association8.8. Association classAssociation class9.9. Create new packageCreate new package10.10. Draw dependencyDraw dependency11.11. Class inheritanceClass inheritance12.12. Interface implementationInterface implementation

Page 9: 1 Rose Class

The class diagramThe class diagram Standard UML class diagramStandard UML class diagram Distinguishes between class inheritance Distinguishes between class inheritance

(plain) and interface implementation (plain) and interface implementation (dotted).(dotted).

Classes, interfaces and associations are Classes, interfaces and associations are items.items.

Right-click on an item to:Right-click on an item to: Change appearance optionsChange appearance options Add attributes and operationsAdd attributes and operations Open spec.Open spec. Anything else…Anything else…

Page 10: 1 Rose Class

Class diagram pitfalls (1)Class diagram pitfalls (1)

Pitfall 1: when adding attr. and Pitfall 1: when adding attr. and operations, pressing operations, pressing enterenter start a start a new item.new item. Click outside the class to exit.Click outside the class to exit.

Pitfall 2: when using Pitfall 2: when using delete delete to delete to delete an item, it is removed only from the an item, it is removed only from the diagram, not from the model.diagram, not from the model. The shortcut to remove an item from The shortcut to remove an item from

the model is the model is ctrl-Dctrl-D, or use right-click., or use right-click.

Page 11: 1 Rose Class

Class diagram pitfalls (2)Class diagram pitfalls (2)

Pitfall 3: Rose uses Pascal notation Pitfall 3: Rose uses Pascal notation for attributes and operation types.for attributes and operation types. The type follows the identifier, using ‘:’.The type follows the identifier, using ‘:’. The return type of a function follows the The return type of a function follows the

function.function. For example:For example:

attr : type attr : type (like (like name : Stringname : String)) func (arg : type) : type func (arg : type) : type (like (like round(f : round(f :

float) : intfloat) : int))

Page 12: 1 Rose Class

Class specifications (1)Class specifications (1)

Page 13: 1 Rose Class

Class specification (2)Class specification (2)

Page 14: 1 Rose Class

Class specification Class specification explainedexplained

The “general” and “details” tabs control The “general” and “details” tabs control various parameters of the class itselfvarious parameters of the class itself

The “attributes” and “operations” tabs The “attributes” and “operations” tabs allows inserting, editing or deleting allows inserting, editing or deleting attributes and operations using right-attributes and operations using right-click.click.

The “relations” tab shows the class The “relations” tab shows the class relations.relations.

Ignore other tabs, for now.Ignore other tabs, for now.

Page 15: 1 Rose Class

Association specification Association specification (1)(1)

Page 16: 1 Rose Class

Association specification Association specification (2)(2)

Page 17: 1 Rose Class

Association spec. Association spec. explainedexplained

The “general” tab allows naming the The “general” tab allows naming the assoc. and the participating classes.assoc. and the participating classes.

Side A is the Side A is the pointedpointed side. Side B is the side. Side B is the pointingpointing..

““Role general” tab allows controlling the Role general” tab allows controlling the role’s name and visibility.role’s name and visibility.

““Role details” controls the important Role details” controls the important things:things: MultiplicityMultiplicity NavigableNavigable Aggregation / containment (e.g. “by value”)Aggregation / containment (e.g. “by value”) Qualifiers and constraintsQualifiers and constraints