xxx9

Exercise 6-3: Clean up Previous Customization
Objectives
● Clean up previous customization.
Scenario
A model of a class previously created needs to be updated. Prior to making model changes,the previous customization needs to be considered and cleaned up. In this exercise, you will perform the required clean up operations against the previous customization so that the updated customization can proceed.
Step 1. Identify the table name associated with a class.
a. Open WTdesigner.mdl.
b. Open the properties for com.customer.CustomerOrder.
c. Select the Windchill tab.
Example:
d. CustomerOrder is a persisted class, since WTDocument was a persisted class. Therefore,CustomerOrder information must be stored in the database. There is a property in the model — TableName — that specifies the table name for a persisted class. The property is TableName property and it is set to <Use Class Name>, which means the name of the database table will be the same as the class name — CustomerOrder.
e. Why is WTDocument a persisted class?
Step 2. Interrogate the database regarding the custom class CustomerOrder.
a. How do you identify the Windchill database user name and password?
b. Log in to SQL*Plus as the Windchill database user.
c. Execute describe CustomerOrder.
d. What are the columns in this table?
Step 3. Interrogate the database regarding the custom class WTDocument.
a. CustomerOrder was extended from WTDocument. What are the columns in the WTDocument table?
b. The columns should be the same since CustomerOrder was extended from WTDocument with no other changes.
Step 4. Clean up previous customization.
a. When changing the model, developers should consider how the changes affect
previously-generated artifacts.
b. In the case of adding an attribute to a custom extension that is persisted, the attribute is stored in a row on a table.

System Generation
mData files are at the center of the system generation process, not the actual model
• This more easily allows for other modeling tools besides Rational Rose to be used for customizing Windchill
mData files are:
• Not a Rational Rose file
• Generated model data files that encapsulate information from the UML model
• Created during the first system generation and updated during subsequent system generation iterations
• Required for system generation of other outputs (e.g. Java and SQL code)
After system generation generates the mData files, the script WT_HOME/bin/JavaGen is executed. If the mData files are already present, JavaGen can be run from the command line to generate artifacts.
Note: Module Descriptor is a function reserved for R&D. Ignore it and do not select it.
Java Source
Java source files are generated when Java Source Code is selected.
The Java source is generated into the WT_HOME/src directory, nested in sub-directories that match the package structure of the customization in Rational Rose.
The location of Java source is controlled by a property wt.generation.source.dir, with a target property file codebase/user.properties.
Java source can be edited without worrying about future system generations overwriting the code as long as edits are made inside “preserve=true” blocks. The following example shows default preserve blocks for import statements, attribute definition, initialization, static initialization and operations:
//##begin user.imports preserve=yes
...
//##begin user.attributes preserve=yes
...
//##begin static.initialization preserve=yes
...
//##begin initialize%47E109400287.body preserve=yes
...
//##begin user.operations preserve=yes
...
Initialization Methods
The default initialization methods created inside the Java code do not fully initialize the object;
developers need to write the initialization logic.
Frequently, the super class initialization methods can be called to perform initialization. Examples:
Discussion question: since the custom initialization methods weren’t properly implemented, how did Windchill create instances of custom objects?
Note: It didn’t call un-implemented initialization methods or it did call Info*Engine.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以使用 JavaScript 和 CSS 实现数据的循环轮播。以下是一个简单的示例代码: HTML: ``` <div class="slider-wrap"> <ul class="slider"> <!-- 动态生成 li 元素 --> </ul> </div> ``` CSS: ``` .slider-wrap { overflow: hidden; width: 100%; } .slider { display: flex; animation: slider 20s linear infinite; } .slider li { flex: 1; margin: 0 20px; text-align: center; } @keyframes slider { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } } ``` JavaScript: ``` const data = [ {name:"111111公司"}, {name:"2公司"}, {name:"3xxx公司"}, {name:"4xxxx公司"}, {name:"xx5xx公司"}, {name:"x6xxx公司"}, {name:"x7xxx公司"}, {name:"x8xxx公司"}, {name:"xxx9x公司"}, {name:"x10xxx公司"}, {name:"x11xxx公司"}, {name:"xx12xx公司"}, {name:"x13xx公司"}, {name:"xx14xx公司"}, {name:"xx15xx公司"}, {name:"xx16xx公司"}, {name:"xxx17x公司"}, {name:"xx18xx公司"}, {name:"xx19xx公司"}, {name:"xxx20x公司"}, {name:"xx21xx公司"}, {name:"x22xx公司"}, {name:"x23xx公司"}, {name:"x24xx公司"}, ]; const slider = document.querySelector('.slider'); // 动态生成 li 元素 for (let i = 0; i < data.length; i++) { const li = document.createElement('li'); li.textContent = data[i].name; slider.appendChild(li.cloneNode(true)); } // 将前三个 li 元素复制一份并添加到 ul.slider 的末尾,以达到循环轮播的效果 slider.appendChild(slider.children[0].cloneNode(true)); slider.appendChild(slider.children[1].cloneNode(true)); slider.appendChild(slider.children[2].cloneNode(true)); ``` 这段代码将在轮播结束后,将前三个 li 元素复制一份并添加到 ul.slider 的末尾,以达到循环轮播的效果。注意,在 CSS 中定义了一个名为 slider 的动画,它将在 20 秒内将 ul.slider 元素向左移动 100% 的距离,从而实现轮播的效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值