* company DataObject That is either associated with a DataGraph or independent
*/
boolean useDataGraph = shouldUseDataGraph();
// define these so that they will be scoped appropriately.
DataGraph dataGraph = null;
DataObject company = null;
if (useDataGraph) {
/**
* The SDO specification says the following about creating a DataGraph. A DataGraph is created by a DAS, which returns either an empty
* DataGraph, or a DataGraph filled with DataObjects. An empty DataGraph can have a root assigned by the createRootObject() methods.
* However, if a previous root DataObject exists then an IllegalStateException is thrown.
*
* In order to create a simple sample which creates a DataGraph without the use of a DAS this sample will use the
* {@link org.apache.tuscany.sdo.util.SDOUtil} class to create a DataObject
*/
dataGraph = SDOUtil.createDataGraph();
company = dataGraph.createRootObject(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");
} else {
/*
* The following creates a DataObject without a DataGraph