Oracle提交了一份关于“J2EE数据绑定及数据访问标准”的标准提案,JSR227,计划将MVC模式中view到controller的数据绑定及访问形式标准化,涉及的MVC实现可能包括Struts、JSF和Swing等。这是个有趣的尝试,如果成功,Java开发者将获得一个统一的MVC数据绑定及访问方法。不过我怀疑它成功的可能性。
下列JSR227的一个简单介绍
——————————————————
Increasingly, enterprise applications model persistent datasources as Java classes and develop Business Services[1] that query, manipulate, and persist these objects. However, developing interactive user interfaces that use Business Services to correctly manipulate the data objects requires understanding and coding against complex sets of design patterns and standards that underly the various Service technologies. This proposed specification will define a framework of classes, called Declarative Bindings, that formalize the characteristic interactions between typical UI components and values and methods available on Business Services. By using the Declarative Bindings set forth in this specificiation, any Java UI rendering technology can declaratively bind to any Business Service. Example UI components and controller technologies include: JSP JSTL tags, JSF, Struts, and Swing. Example business services include SOAP Web Services, EJB Session Beans or any Java class being used as an interface to some functionality.
When accessed by the UI components and UI controller, the metadata-driven Declarative Bindings interact with the classes that they are bound to, providing J2EE standards-compliant support for things like:
- Binding (locating and accessing)
- single attribute (appropriate for input fields and other single value UI components)
- objects with related collection attributes (appropriate for tree controls)
- collections of objects (appropriate for displaying in tables)
- Navigating
- current row tracking (first, next, prev, last)
- current range (appropriate for scrollbar pagination)
- coordinating related collections (appropriate for master/detail display)
- multiple iterators sharing same collection (appropriate for split pane)
- Performing actions
- normalizing the interaction of generic insert, update and delete operations on transactional objects and collections of objects
- surfacing status of bound objects (to know whether the UI component needs to be re-rendered)
- dispatching to methods to perform custom services.
- validating and reporting validation exceptions.
Declarative Bindings completely decouple the user interface from the data portions of the application. In the nomenclature of MVC application architectures, this specification standardizes metadata and behavior for binding to elements of the Model from both the View and the Controller.
The Declarative Binding classes provide attributes that are easily accessible to all user interface technologies that support EL or Java. Declarative Bindings manage the interaction with Business Services. They drive their behavior off metadata, which is convenient for tools vendors. One of the goals of this proposal is allow interoperability between tools products that interactively bind sophisticated interfaces to the services that provide the data.
To facilitate a common mechanism for accessing diverse Business Service technologies this specification proposes that the Declarative Bindings access the Business Services via a lightweight abstraction layer called Data Controls.
Data Controls provide supplemental metadata about the Business Service's capabilities and constraints as well as support a simple interface for normalizing typical interactions with the Service. Data Controls comprehensively describe the attributes and methods so that UI components can make intelligent assumptions about how to render the data. In addtion, the Data Control standardizes access to functionality that is typically required by data-intensive, interactive user interfaces. Examples of functionality could include how the Business Service is instantiated, navigated, invoked, sychronized, transacted or released. This JSR will not impose any requirements for the types of attributes or methods on the Data Control or any implementation requirements. Those decisions will be left to the implementor of the Data Control and revealed to the Declarative Bindings and UI via the Data Control interface.
[1] By Business Service we mean any class that publishes objects and provides methods that manipulate the objects. I.e. The actual term may vary according to the Business Service technology, SessionFacade, WebService, ApplicationModule, etc.
分享到:
相关推荐
### JSR227:为J2EE提供标准的数据绑定与数据访问机制 #### 一、概述 JSR227(Java Specification Request 227)是一项由Oracle提出的标准,旨在为Java 2 Platform, Enterprise Edition (J2EE)平台提供一种通用的...
- **Web UI数据绑定与JSR-227**:SDO可以帮助实现UI组件与后端数据源之间的绑定。 - **JCA与JMS**:SDO可以与JCA和JMS一起使用,处理来自企业信息系统的数据。 #### 七、结论与展望 通过引入SDO,开发者可以以更...
SDO与其他技术的关系密切,它可以作为JDBC、JSR-114、实体EJB、JDO、Hibernate等持久性框架、Java-XML绑定、XQuery、JSR-225、Web UI数据绑定、JCA与JMS等技术的补充。例如,SDO可以与JDBC结合使用,提供更高级别的...
JSR-303的发布使得在数据自动绑定和验证变得简单,使开发人员在定义数据模型时不必考虑实现框架的限制。
6. **JAF(JavaBeans Activation Framework)**和**JSR 175(Annotations)**:JAF用于处理不同类型的MIME数据,而JSR 175引入了注解,简化了代码的元数据声明。源码可能展示了如何使用注解进行类型安全的属性访问,...
J2EE架构由多个层次组成,包括客户端层、Web层、业务逻辑层和数据访问层。这些层之间的通信通过标准接口和服务进行,确保了组件间的松耦合。 - **客户端层**:通常包含桌面应用或轻量级浏览器应用,与服务器通过...
1. **多层架构**:J2EE支持四层架构(客户端、Web层、业务逻辑层、数据访问层),使得系统职责明确,易于维护。 2. **组件化**:通过EJB(Enterprise JavaBeans)等组件模型,实现代码的模块化和复用。 3. **安全性*...
它简化了数据访问,让开发者可以使用面向对象的方式操作数据库。 5. **JMS (Java Message Service)**: JMS提供了一种标准的方式来创建、发送、接收和读取消息,用于实现异步通信和解耦应用程序组件。 6. **JTA ...
6. **JNDI(Java Naming and Directory Interface)**:JNDI提供了一个统一的接口,用于查找和绑定各种资源,如EJB、数据源和邮件服务器等。 7. **JAF(JavaBeans Activation Framework)**与JSR 181(Web Services...
此外,还引入了JSR 170的内容管理系统API(Java Content Repository API),允许开发人员访问和管理内容存储库。 ### 学习J2EE 1.4的重要性 尽管后来的J2EE版本演变为Java EE,并进一步发展为 Jakarta EE,但J2EE ...
- **JSR-181到JSR-109部署描述符的映射**:解释了如何将JSR-181元数据映射到JSR-109部署描述符中,以便在J2EE容器中部署。 #### 8. 使用JSR-181注解来影响WSDL的形状 - **RPC/Literal风格**:描述了如何使用JSR-...
此外,portlet还提供了额外的功能,如持久性数据存储、用户概要访问、URL重写和不同作用域的瞬变数据存储。 Portlet容器扩展了Servlet容器的功能,符合J2EE 1.3规范。它负责提供portlet运行所需环境,确保portlet...
JPA 1.0在J2EE 5.0中首次引入,提供了一种声明式的方式处理数据库操作,简化了数据访问层的编写。 4. **EJB (Enterprise JavaBeans)**: EJB是J2EE中的核心组件模型,用于构建可部署的业务逻辑。在J2EE 5.0中,EJB ...
1. **Java EE架构**:J2EE架构基于层的概念,包括表示层、业务逻辑层和数据访问层。这些层之间通过接口进行通信,确保了良好的模块化和职责分离。 2. **Servlet和JSP**:Servlet是Java编写的小型服务器端程序,处理...
JAXB 2.0是J2EE 5中用于XML绑定的工具,它允许开发人员将XML数据自动映射到Java对象,反之亦然。这一版本引入了注解支持,使得XML到Java的映射更加直观和简洁。 **4. JPA 1.0(Java Persistence API)** Java ...
XML,全称可扩展标记语言(Extensible Markup Language),在J2EE(Java 2 Platform, Enterprise Edition)环境中扮演着重要角色,它提供了一种独立于应用程序和平台的数据表示方式,便于数据交换和集成。...
JDK(Java Development Kit)是Java编程语言和Java平台的标准版开发工具包,而J2EE则是用于构建企业级分布式应用的平台。 描述中提到"JDK的文中文的",意味着这些API文档是中文本地化的,对于中国或其他使用中文的...
J2EE应用通常采用三层架构:表现层(Presentation Layer)、业务逻辑层(Business Logic Layer)和数据访问层(Data Access Layer)。表现层由Web组件组成,负责用户交互;业务逻辑层由EJB或Java类实现,处理业务...
7. **JAF(JavaBeans Activation Framework)** 和 **JSR(Java Specification Requests)**:前者支持MIME类型和数据对象的激活,后者是Java社区进程定义新API和规范的机制。 8. **Web服务(Web Services)**:...