Decision

Decision: Option B, Access methods on the CPS; Data object provides context to those methods.

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.

Note that the options are not proposing the interface for the CPS. The samples are only meant to illustrate the different styles.

Option A

Access methods are associated (encapsulated) in an object representing the data.

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

Access methods are associated with the CPS. Data is provided as context.

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));
}

Discussion

Option A style brings in a lot of implementation overhead for very little benefit
Option B style has methods on the CPS object: cps.getParent(object_with_parent)
The CPSDataObject will be be a strongly typed object that includes an identifier known to the CPS
The return will be a strongly typed object that encapsulates info about the object.

It will be easier to create REST interface from the Option B style

There will be some way to set the 'identity of the tree' (uuid_to_identify_inventory_item) in the CPS instance. The CPS will be populated by many independent trees/graphs. Many of these will be structurally identical as they will represent instances of the same type of xNF (for example). A mechanism is required to address the instance. This is tightly coupled with the inventory id from A&AI

Discussed Fri 17/June: Broad agreement with Option B. Discussion taken with Data Representation. Decision will be approved unless major objection Fri 24/June.

  • No labels