Dynamic Object Model

SDO metadata is represented as Type and Property objects. A Type is comparable to a Java class, and a Property -- to a Java field. You define this metadata at run time either programmatically or from an XML schema, as follows:

Data is represented as instances of Type called DataObject. The DataObject in SDO corresponds to a Java Object and have many generic accessors that you can use to manipulate the data, as the following example shows:

A DataObject's properties can contain simple values, other data objects, or Lists of simple values or DataObjects. Data objects can contain references to other data objects, or they can contain them.

Typed Object Model

SDO as a dynamic object model is useful in certain frameworks based on the fact that dynamic models let you add metadata without requiring a redeployment of your application. However, in some cases a strongly typed model is required that allows for code completion in an IDE. You can perform a code generation step to produce typed interfaces complete with bean-style accessors, as the following example shows:

Disconnected Object

SDO was designed to represent disconnected data in a Service Component Architecture (SCA) environment. You can do so by using the ChangeSummary that tracks changes made to data objects over time. Note that this applies to DataObject instances that have a ChangeSummary property. Consider the following example:

List changed = customerDO.getChangeSummary().getChangedDataObjects();

EclipseLink is focused on separating data from its messaging or persisted representations. With SDO support this data can be a POJO or a data object, which allows you to work with data in both Java EE and SCA environments.