Decision
Details
The access interface needs to suit the users of the data. It must also acknowledge the underlying data structure.
There are two main options: Providing behavior interfaces on a logical representation of the data; Providing behavior interfaces on the CPS and explicitly providing reference to the data
Option A
CPSDataObject cpsRootObject = CPS.getRootObject(uuid_to_identify_inventory_item); System.out.println(cpsRootObject); List<CPSDataObject> kids = cpsRootObject.getChildren(); for (CPSDataObject kid: kids) { System.out.println(kid.getParent()); }
Option B
CPSDataObject cpsRootObject = CPS.getRootObject(uuid_to_identify_inventory_item); System.out.println(cpsRootObject); List<CPSDataObject> kids = CPS.getChildren(cpsRootObject); for (CPSDataObject kid: kids) { System.out.println(CPS.getParent(kid)); }