`
xiaogyiy
  • 浏览: 79743 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论
阅读更多
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.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics