Concept: Web Application Frameworks
This Concept describes how Service Data Objects (SDO) support the development of Web Applications.
Relationships
Related Elements
Main Description

Introduction

Service Data Objects is a specification for a programming model that allows access to back-end data in a uniform, data source independent and disconnected way. The model allows data to be retrieved from any type of data source (Relational Database, EJB Entity Beans, Web Service, XML data source, and so forth) and presented uniformly as a structured graph of data (DataGraph). SDO provides for disconnected operations by allowing the retrieval of the DataGraph to be independent of any back-end connections or transactions. It is still a proposed specification submitted through the JCP as Java Specification Request (JSR) 235.

Architecture

The SDO architecture uses a uniform data access layer (Data Mediator Service) to return DataGraphs to clients from heterogeneous data sources. Figure 4 shows the components of the SDO architecture.

SDO Architecture Data object

Figure 4: SDO Architecture DataObject

A DataObject holds actual data (for example, primitive values or row of data from a relational database) and possible references to other DataObjects. It can be introspected to determine its type, relationships, and constraints.

DataGraph

A DataGraph holds a set of DataObjects and typically represents the unit of transfer between components in the architecture. It records all changes to data, including new, changed or deleted Data Objects.

Data Mediator Service

A Data Mediator Service is responsible for interacting with a Data Source to produce DataGraphs representing the data. Native data representation is converted to the SDO graphical representation by this pluggable service. The Mediator is also responsible for applying changes in a DataGraph back to the Data Source.

Framework Applicability

SDO technology promises easy tool and framework integration. In the context of JSF and other MVC frameworks, the following two solutions can be considered:

Binding from UI component to SDO (JSF)

In a JSF framework, values for Web user interface components can be declaratively bound to SDOs for data retrieval purposes. For example, a Data Table component could be bound to an SDO for retrieval of its values from a back-end data source. This combination makes data connectivity from a UI component easy with no programming required. Figure 5 shows the resulting architecture of binding JSF UI components to SDOs.

Using SDOs with JSF

Figure 5: Using SDOs with JSF

Model object to SDO (any MVC framework)

The model layer of an MVC framework could use SDOs to access back-end data. Figure 6 shows an example of a model client using SDOs to access data persisted using Entity EJBs. The model object uses DataGraphs returned by a Stateless Session EJB facade. This Session bean facade, in turn, retrieves the DataGraphs from the Mediator, which acts as a data facade for the Entity EJB based persistence mechanism.

Using SDO with Model objects and EJBs

Figure 6: Using SDOs with Model objects and EJBs

Resources

The following links provide additional information related to the application frameworks and component technologies discussed in this document: