xxx8

Exercise 6-2: Model Constructor Operations
Objectives
● Add constructor operations to an existing class modeled in Rational Rose.
Scenario
In this exercise, you will add the required constructor operations to an existing class modeled in Rational Rose.
Step 1. Open Rational Rose and WTdesigner.mdl.
Step 2. Open the Attribute Specification window for CustomerOrder.
a. Navigate to com.customer.doc.
b. Double-click on CustomerOrder, or right-click on CustomerOrder and select Open Specification...
Result:
Class Specification Window
c. Select the Operations tab.
d. Clear the Show inherited check box. There should be no attributes in this class, that is no operations besides inherited operations.
e. Select the Show inherited check box.
Step 3. Create constructors.
a. Sort the attributes by Parent by selecting the Parent column header.
b. Scroll down to the list to operations directly from the parent class, WTDocument. There should be 3 constructor operations. Select these 3 operations using typical CTRL+select or SHIFT+select techniques for multi-object selection.
c. Copy and paste the operations, either with the right-click menu or with CTRL+c and CTRL+v.
d. Clear the Show inherited check box. There should now be 3 operations in CustomerOrder,although right now they are incorrectly named WTDocument() instead of CustomerOrder().
Example:
e. Rename the first operation to CustomerOrder() by double-clicking on the operation.
The Operation Specification window will open. Rename the operation name to CustomerOrder:
Example:
f. Select OK.
g. Rename the next operation by using the mouse to slowly select the operation name 2 times, and typing CustomerOrder:
Example:
h. Rename the final operation.
Step 4. Save the changes.
Step 5. System generate.
a. Remember to select a modeled class, not an OOTB class.
Step 6. Recompile.
a. Since the model definition has changed, the artifacts have changed.
b. Recompile the Java classes.
Step 7. Restart Tomcat and the Method Server.
Step 8. Test.
a. Nothing has significantly changed in the model or artifacts, so no significant difference will be seen during the test.
b. This step will confirm everything is still correct before continuing.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值