I enjoyed the article from IBM on Service Data Objects.
Things have gone a little quiet on the SDO front for awhile, so it is good to see example code.
It is interesting to look at how the API is used:
// Get the SDO DataGraph from the DMS.
DataGraph employeeGraph = mediator.get(employeeName);
…
// Get the root object
DataObject root = employeeGraph.getRootObject();
…
// get the employee under the manager
employee = theManager.getDataObject(”employees.0″);
The API looks very generic. Similar to JDBC (get/set/Int/String etc).
The data graph that you are working with plays nicely with XML:
<?xml version="1.0" encoding="UTF-8"?> <sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:company="http://com.example.company.ecore" xmlns:sdo="commonj.sdo" xmlns:sdo_1="http://www.eclipse.org/emf/2003/SDO"> <changeSummary> <objectChanges key="#//@eRootObject"> <value xsi:type="sdo_1:EChangeSummarySetting" featureName="department" dataValue="Board"/> </objectChanges> </changeSummary> <company:Employee name="The Big Boss" number="1" department="The new department" title="Mr." manager="true"> <employees name="Terence Shorter" number="2" department="The new department" title="Mr." manager="true"> <employees name="Miles Colvis" number="3" department="The new department" title="Mr."/> <employees name="John Datrane" number="4" department="The new department" title="Mr."/> </employees> </company:Employee> </sdo:datagraph>
The more I see of this, the more that I see SDO and JDO/The New Persistence API working together. SDO can be used on the service boundaries, and as ways to access data across services. But I still want to have an object model, in which I persist things, and for that I want to use a transparent persistence solution.