Service Data Objects (SDO)

SDO (Service Data Objects) is a framework for data application development, which includes an architecture and API. WebSphere Commerce utilizes the SDO capabilities for XML marshalling and unmarshalling, and code generation from XSD to static Java objects. The SDOs themselves are Java object representations of your nouns, and can be easily traversed by using getters.

SDO provides the following benefits:

In Java, the data objects of the service module (contained in the data object project) are represented as service data objects (SDOs). This module contains the XSDs of the data objects along with the WSDL of the services and the generated SDO code to be used by the component facade implementation and the Java client.

An example of a SDO is com.ibm.commerce.member.facade.datatypes.impl.PersonTypeImpl, which implements the com.ibm.commerce.member.facade.datatypes.PersonType interface. To get information from the SDO, you need to know its XPath. For example, the XPath of a person's logon ID is as follows: /Person/Credential/LogonID

To get this information from the Person SDO, you would write the following Java code:

When an SDO getter returns a List, refer to the Javadoc to determine the type of the List elements. For example, the list of contacts in a person's address book is of type com.ibm.commerce.foundation.common.datatypes.ContactInfoType:

See

Introduction to Service Data Objects on the IBM DeveloperWorks for a good introduction to SDO.


SDO annotations

SDO annotations are Eclipse Modeling Framework (EMF) annotations for generating Java code based on XSDs. SDO annotations can be added to the XSD to assist the EMF tooling to specify the package name and XML namespace prefix when creating the .genmodel as a basis to generate SDOs. This extension is to add the following namespace and package declaration to every schema defined. The namespace element is the EMF syntax definition to allow the package attribute to be specified. This package attribute is used by the tools to generate the package name of the generated objects. In the example below, the generated SDO is com.ibm.commerce.catalog.facade.datatypes.

See the article on the dev.eclipse.org Web site.

Note: The word class is reserved by SDO. If you use class as a property name, an underscore _ is added to provide a unique name when EMF generates the SDOs. However, it does not update the configuration files, and manual updates are necessary. For example:In the wc-business-object-mediator.xml file:

In the wc-object-relational-metadata.xml file:


Programming guidelines for WebSphere Commerce Business Objects

The following programming guidelines can help us create business objects that conform to the expected default structure implemented in WebSphere Commerce.


Related concepts
WebSphere Commerce use of Open Applications Group (OAGIS) messaging
Client library for WebSphere Commerce services


Related tasks
Creating and updating Service Data Objects (SDO)
Generating code from an SDO genmodel file
Updating Service Data Objects