ADF与JSF的区别

本文对比了ADF与JSF在模型层实现上的不同。ADF利用DataControl和声明式的DataBinding解耦了UI与业务逻辑,而JSF则依赖ManagedBeans进行数据绑定。文章详细介绍了这两种技术的具体工作方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

经常被问到ADF与JSF的区别,二者的主要区别是在模型层的实现上,以下做一简要说明。

In a typical JSF application, you would create objects like the userInfoBean object as a managed bean. 
在一个典型的JSF应用中,你会使用类似于userInfoBean这样的对象作为Managed Bean。
The JSF runtime manages instantiating these beans on demand when any EL expression references them for the first time. 
JSF在运行时会根据情况初始化这些Beans,比如EL表达式中索引到了这些Beans。
However, in an application that uses the ADF Model layer, instead of binding the UI component attributes to properties or methods on managed beans, JDeveloper automatically binds the UI component attributes to the ADF Model layer, which uses XML configuration files that drive generic data binding features. 
然而,一个使用了ADF Model的应用,不是把UI组件绑定到Managed Bean的属性或方法上,而是将其绑定到ADF Moel层:使用XML配置文件来驱动数据绑定关系。
It implements the two concepts in JSR-227 that enable decoupling the user interface technology from the business service implementation: data controls and declarative bindings.
它使用了JSR-227标准中的两个概念:Data Control和声明式的Data Binding,从而解耦了UI层和业务服务层,即UI组件与业务服务层的实现无关。

In the model layer, Oracle ADF Model implements the JSR-227 service abstraction called the data control. 
在模型层,ADF Model实现了JSR-227服务抽象标准:Data Control。
Data controls abstract the implementation technology of a business service by using standard metadata interfaces to describe the service’s operations and data collections, including information about the properties, methods,and types involved. 
Data Control通过使用标准的元数据接口来描述服务的操作和数据集合(包括属性、方法、数据类型),从而抽象了业务服务层的实现。
Using JDeveloper, you can view that information as icons that you can then drag and drop onto a page. 
At that point, JDeveloper automatically creates the bindings from the page to the services. 
使用JDeveloper,你可以拖放Data Control到页面上,创建UI组件的同时生成与业务服务的绑定关系。
At runtime, the ADF Model layer reads the information describing your data controls and data bindings from appropriate XML files and implements the two-way connection between your user interface and your business service.

在运行时,ADF Model层通过读取一些XML文件来获得Data Control和Data Binding信息,从而在UI层和业务服务层之间建立了“双向连接”。

http://maping930883.blogspot.com/2009/09/adf045adfjsf.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值