ADF BC中AM, EO, VO的初始化顺序

关键字: ADF BC,AM,EO,VO,定义,实现,初始化

开发环境:JDeveloper 11.1.1.3.0


1,  测试代码介绍

基于HR Schema,创建Employees、Departments表的EO、VO对象。


2,  创建DepartmentEO,DepartmentVO, EmployeeEO, EmployeeVO的定义类和对象类。



3,在类中添加输出信息

例如:

public AppModuleImpl() {
        System.out.println("create application module instance impliment...");
}


4, 运行业务组件浏览器

得到测试结果如下:

create applicaton moduledefination...

create application moduleinstance impliment...

employee VO defination...

employee eo defination ...

employee VO instance ...

department VO defination

department EO impliment

department VO impliment


5,  修改ViewUsage顺序,再次测试

不同VO的初始化顺序不会和AM实现类中的getXXXVO顺序一致,而是与AM的XML定义中的‘ViewUsage’的定义顺序一致。

create applicaton moduledefination...

create application moduleinstance impliment...

department VO defination

department EO impliment

department VO impliment

employee VO defination...

employee eo defination ...

employee VO impliment ...





6,  运行页面

1)保持EmployeeVO的使用早于DepartmentVO的使用的情况下,运行Departments.jspx页面。结果如下。

createapplicaton module defination impliment...

createapplication module instance impliment...

employeeVO defination...

employeeeo defination ...

employeeVO impliment ...

departmentVO defination

departmentEO impliment

departmentVO impliment

… …

2)接着运行Employees.jspx页面:

create application module instanceimpliment...

employee VO impliment ...

department VO impliment

employee EO instance ...

employee EO instance ...

employee EO instance ...

… …

3)等待页面超时,Session无效后再打开,此时AM实例没有超时:

employee VO impliment ...

department VO impliment

employee EO instance ...

employee EO instance ...

employee EO instance ...

… …


4)在AM超时后:

<StateManagerImpl><restoreView>无法为标记 etzaygn6g 找到保存的视图状态

employee VO impliment ...

department VO impliment

employee EO instance ...

employee EO instance ...

employee EO instance ...

… …


7,  总结

1)  在第一次打开ADF页面的时候,初始化AM、EO、VO的定义;顺序是AM,VO,EO。

2)  VO对象类的初始化晚于EO的定义,晚于VO的定义。

3)  EO对象类对应的是table中的一行数据,所以log中打印出多行EO对象类的初始化。并且,EO对象类的初始化晚于VO对象类的初始化。

4)  不同VO的初始化顺序定义在AppModule.xml文件中,同‘ViewUsage’的顺序。

5)  在页面Session失效后,再次打开页面,只进行了VO对象类的初始化。AM、EO、VO的定义类并没有重新初始化。

6)  默认,AM实例的time out时间是600s。AM超时后,AM、EO、VO的定义类也没有重新初始化,说明这些类的初始化只进行了一次,是在ADF应用部署完成后的首次访问。


8,测试代码下载

ADF BC 初始化顺序测试代码




  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
以下是一个简单的ADF4356初始化代码,用于配置ADF4356以输出一个特定的频率。请注意,这只是一个示例代码,并且需要根据您的具体需求进行修改和调整。 ```c #include "stm32f4xx.h" #define ADF4356_REG0 0x00 #define ADF4356_REG1 0x01 #define ADF4356_REG2 0x02 #define ADF4356_REG3 0x03 // 其他寄存器定义... void ADF4356_Write(uint32_t reg, uint32_t value) { // 将reg和value写入ADF4356的SPI接口 // ... } void ADF4356_Init(void) { uint32_t ref = 10000000; // 参考时钟频率为10MHz uint32_t freq = 1000000000; // 输出频率为1GHz uint32_t divider = 0; uint32_t reg0 = 0, reg1 = 0, reg2 = 0; // 计算分频器值 divider = (freq / 25) - 1; // 设置寄存器0 reg0 = (1 << 14) | (divider << 3); ADF4356_Write(ADF4356_REG0, reg0); // 设置寄存器1 reg1 = (1 << 15) | (1 << 13) | (1 << 12) | (1 << 11) | (1 << 4) | (1 << 3) | (1 << 2) | (1 << 1) | (1 << 0); ADF4356_Write(ADF4356_REG1, reg1); // 设置寄存器2 reg2 = (1 << 15) | (1 << 14) | (1 << 12) | (1 << 11) | (1 << 3) | (1 << 2); ADF4356_Write(ADF4356_REG2, reg2); // 设置参考时钟分频器 reg3 = (1 << 15) | ((ref / 1000000 - 1) << 3); ADF4356_Write(ADF4356_REG3, reg3); } int main(void) { // 初始化SPI接口等硬件 // ... // 初始化ADF4356 ADF4356_Init(); while (1) { // 主循环 } } ``` 这个例子代码假设您已经完成了SPI接口的初始化,并且已经有一种方法可以将数据写入ADF4356的SPI接口。在代码,`ADF4356_Write`函数用于将数据写入ADF4356的寄存器,`ADF4356_Init`函数计算了分频器值及其他寄存器的值,并将其写入ADF4356的寄存器。此外,该代码还设置了参考时钟分频器以确保参考时钟的正确频率。
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值