Network Deployment (Distributed operating systems), v8.0 > Applications > Service integration > Mediations > Mediation programming
SDO data graphs
Service Data Objects (SDO) is an open standard for enabling applications to handle data from different data sources in a uniform way, as data graphs. SDO data graphs are an important concept for mediation programmers because you can use them to represent different types of message information in a standard way, giving a simple and powerful model for programming mediations.
Use SDO, the applications can uniformly access and manipulate data from diverse data sources including relational databases, XML data sources, Web services, and enterprise information systems.
SDO data graphs are structured collections of data objects. In general, data graphs generated from messages have a tree structure. A mediation retrieves a data graph from a message, transforms the data graph, and reflects the updates to the data graph in the message.
In WAS, data access services connect mediations to data sources, allowing mediations to manipulate an abstract representation of the message, the SIMessage. The SIMessage API provides a method, getDataGraph(), that returns the SDO data graph containing the SIMessage content in a tree representation, or graph of data objects. Each data object represents one or more fields in the message, or it points to other objects.
When a data graph is requested from a message, the appropriate data access service is identified by a format property in the SIMessage. The format string controls which data access service is used to process the message, and can contain additional control information for that data access service. The data access service controls the structure of the message. For more information about the data access services available in WAS, see Map of SDO data graphs for web services messages.
The SIMessageContext API provides access to:
- The SIMessage, and its rich set of message manipulation methods
- The SIMediationSession, for Service Integration technologies functions
Data objects hold their data as a set of named properties. Each property has a type that is either an attribute type (for example, int) or a commonly used data type (for example, Date). If the property is a reference, it has the type of another data object. The Data Object API provides a dynamic data API for manipulating these properties, with the following interfaces that relate to instance data:
- The DataObject interface provides a set of methods to retrieve and update the contents of a data object. It also provides methods to perform the following actions:
- Access the container of the data object and the data graph to which the data object belongs
- Create a new instance of a contained data object
- Delete a data object from its container
The DataObject interface also provides the ability to get the type of the data object.
- The DataGraph interface is a graph of data objects. The graph consists of a single root data object and all the data objects that can be reached by recursively traversing the containment references of the root data object.
SDO also contains a metadata API for examining the model of a data graph, consisting of Types and Properties:
- A Type has a set of Property objects. SDO Types can be compared with type definitions in other type systems. For example, the SDO view of a Java Class is a Type, with each field in the Class represented by a Property. For XML Schema, a ComplexType is represented by a Type, with a Property for each element or attribute.
- A data object is composed of properties.
To access a property, specify the Property object, the name of the property, or the index of the property.
The version of SDO data graphs used by mediations is v1. Data graphs provided by the SIMessage and SIDataGraphFactory interfaces can only be provided to other SIMessage objects. Data graphs provided to SIMessage objects can only come from other SIMessage objects or have been constructed using the SIDataGraphFactory. Concept topic