rational rose 使用技巧

29
Rational Rose 使使使使 使使使使使使 使使 使使使使 使使使 使使使使 () 使使使使使使 2000.11

Upload: hilda-sawyer

Post on 15-Mar-2016

165 views

Category:

Documents


4 download

DESCRIPTION

Rational Rose 使用技巧. 首席软件专家 张恂 博讯科技(上海)有限公司 浩方科技集团 2000.11. 主要内容. Model workspace 团队开发 Web Publisher REI. Model workspace. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Rational Rose 使用技巧

Rational Rose使用技巧

首席软件专家 张恂博讯科技(上海)有限公司

浩方科技集团2000.11

Page 2: Rational Rose 使用技巧

主要内容• Model workspace• 团队开发• Web Publisher• REI

Page 3: Rational Rose 使用技巧

Model workspace

• A saved Rational Rose model contains the diagrams, elements, and controlled units that make up the complete model. A model workspace contains the actual state of open diagrams and controlled units for a specific saved model at a given point in time.

• It is possible to have multiple workspaces corresponding to only one model.

Page 4: Rational Rose 使用技巧

团队开发Controlled units (.cat),由版本控制软件管理,多人并行工作。– The model (.mdl file)

– Logical packages and use-case packages (.cat file)

– Component packages (.sub file)

– Deployment diagram (.prc file)

– Model properties (.prp file)

– External files associated with model elements

Page 5: Rational Rose 使用技巧

单元写保护• If a write-protected controlled unit contains

other controlled units, the write-protection is not extended to the contained controlled units.

Page 6: Rational Rose 使用技巧

virtual path map

• Workspace– integration workspace– private workspace

Page 7: Rational Rose 使用技巧

策略一• 一个控制单元一次只允许一个人访问。• 每个人都在模型元素的主干上工作。

Page 8: Rational Rose 使用技巧

策略一The following updates need to be made:• Joe needs to update user_serv.cat• Jim needs to update business_serv.cat• Jill needs to update data_serv.cat1. Each developer opens the ordersys.mdl model in their private workspaces. B

ecause each developer has defined a virtual path for their private workspaces, the path to the referenced .cat files is resolved in the context of each developer‘s workspace. In Jill‘s case, Rational Rose looks for the .cat files in Y:\ordersystem\units because Jill mapped her ClearCase view to the "Y" drive.

2. Each developer checks out the package (controlled unit) that they need from their version control system. Because they are using a SCC-compliant version control system (properly set up to work with the Version Control add-in), they right-click on the package in the browser and click Check Out on the shortcut menu. They will have read-write access only to the package they check out.

Page 9: Rational Rose 使用技巧

策略一3. Each developer makes the necessary changes to the

package they have checked-out, without impacting other packages.

4. After their changes are made, the changes are reviewed for acceptability before the controlled units are checked back in.

5. Once the changes are approved, each developer checks in their controlled unit. This is done by right-clicking on the unit‘s package in the browser and clicking Check In on the shortcut menu.

6. Developers can update their models with each other‘s changes by using the Get Latest command in the Version Control add-in.

Page 10: Rational Rose 使用技巧

策略一Both Joe and Jill need to update user_serv.cat.1. Jill, who is the owner of user_serv.cat unit, creates two subpack

ages in the User Services package. One package is for her updates, and the other is for Jim’s updates.

2. Then she moves the model elements of interest from the User Services package to the two subpackages.

3. Jill adds the two new packages to version control.4. Joe and Jill modify their subpackages. When the work is comple

te, Jill uncontrols the temporary subpackages, relocates the contained model elements to the original package (including any associations) and deletes the now empty temporary subpackages.

Page 11: Rational Rose 使用技巧

策略二• 每个成员在独立分支上工作。Both Joe and Jill need to update user_serv.cat. The following happens:1. Joe and Jill open the ordersys.mdl model in their private workspaces. Bec

ause they both have defined a virtual path for their private workspaces, the path to the referenced .cat files is resolved in the context of each developer’s workspace. For example, in Jill‘s case, Rational Rose looks for the .cat files in Y:\ordersystem\units.

2. Joe checks out user_serv.cat. Because he is using the ClearCase add-in, he right-clicks on the package in the browser and then clicks Check Out. ClearCase checks out a version of the unit onto Joe’s private version branch.

3. Jill checks out user_serv.cat onto her separate version branch.

Page 12: Rational Rose 使用技巧

策略二4. Joe finishes his changes and checks in user_serv.cat. To do this, he right-cli

cks on the package in the browser and clicks Check In on the shortcut menu. ClearCase checks in the file on the version branch that is referenced by Jim’s view.

5. Jill finishes her changes and checks in her version of user_serv.cat. ClearCase produces a new version of the file on Jill‘s private development branch.

6. Once Joe‘s and Jill’s changes are reviewed and accepted, the project leader (or a designated developer) uses the Model Integrator to merge their changes into the baseline version of the model. (For more information refer to the Model Integrator online help.)

7. The other developers can view Joe‘s and Jill’s changes when reloading the user_serv.cat unit from the baseline model. The unit can be reloaded using the Get Latest command in the ClearCase add-in.

Page 13: Rational Rose 使用技巧

Web Publisher

• you can select which views of a model are published, the amount of detail to include, the notation to use, and the graphics format for Rose diagrams

• Rose Web Publisher recreates Rose model elements, including diagrams, classes, packages, relationships, attributes, and operations. Once published, hypertext links enable you to traverse the model much as you would in Rose.

Page 14: Rational Rose 使用技巧

Web Publisher Output

• strongly recommend that you segregate each model or version of a model in its own folder. That way, if a version is outdated or no longer relevant, you can delete the entire folder without concern that you‘re deleting newer material.

Page 15: Rational Rose 使用技巧

菜单定制• Menu Extensibility• Shortcut Menu Extensibility

Page 16: Rational Rose 使用技巧

Customized Menu Commands

• Execute a program or shell script• Execute a Rational Rose script• Load or save controllable units• Display a dialog for user input• Change write protection for a controllable unit• Specify an editor for viewing results of the Model

Integrator add-in• Execute an interface in a COM server (for example,

from your add-in)

Page 17: Rational Rose 使用技巧

Menu Extensibility

• 修改 rose.mnu

Page 18: Rational Rose 使用技巧

Rose Extensibility Interface

• Full-featured Basic Scripting language• customized version of Summit Basic Script

Page 19: Rational Rose 使用技巧

REI用途• Get information out of a model

– Extract all or a portion to export– Generate custom reports

• Perform checks on the model– Enforce project/enterprise semantic check– Print to a log window

• Create information to model– Add/update model components– Create/update interaction, class diagrams

• Integration with third-party tools

Page 20: Rational Rose 使用技巧

执行方式• 交互式• 编译成 ebx文件,通过菜单执行

Page 21: Rational Rose 使用技巧

RoseScript类• Application类属性 Visible• Application类方法 OpenModel• RoseApp.CurrentModel• RoseApp.Height• RoseApp.CurrentModel.Save

Page 22: Rational Rose 使用技巧

基本语法• 注释

‘This is a comment• 声明例程 Sub Name(arglist)• 结束例程

End Sub or Exit Sub• 主例程

Main()• 声明局部变量

Dim var As type

Page 23: Rational Rose 使用技巧

基本语法• 输出

Print• 针对集合或数组中的每个元素循环

For Each member in group[statements][Exit for][statements]

Next [member]

Page 24: Rational Rose 使用技巧

基本语法• While/Until循环1) Do {While|Until} condition

statements Loop2) Do

statements Loop {While|Until} condition

3) Do statements Loop

Page 25: Rational Rose 使用技巧

ViewPort

• RoseScript结果输出窗口。• Viewport.Clear• Viewport.Close• Viewport.Open

Page 26: Rational Rose 使用技巧

Rose Scripts

• Hwizard• importdoc• metrics:统计类、包、构件和子系统。• model_builder• pathmapconvert• palysnd• printclassinheritance

Page 27: Rational Rose 使用技巧

Rose Scripts

• Browser• compdir• compile• diagram_show• excel• exec• exportdoc

Page 28: Rational Rose 使用技巧

Rose

• Renmcls• startscript

Page 29: Rational Rose 使用技巧

REI例子Sub PrintPackage(theModel As Model)

Dim thePackage As CategoryDim PackageID As IntegerDim allPackages As CategoryCollection

Set allPackages = theModel.GetAllCategories()For PackageID = 1 To allPackages.Count

Set thePackage = allPackages.GetAt(PackageID)Print thePackage.name

Next PackageIDEnd Sub

Sub MainViewport.openPrintPackage RoseApp.CurrentModel

End Sub