2009年9月28日星期一

ADF_045:ADF与JSF的区别(翻译+整理)

经常被问到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层和业务服务层之间建立了“双向连接”。

没有评论: