ODX Metamodel Implementation
This Ecore implementation of the ODX metamodel is based on the EMF XSD2Ecore import,
followed by a post-processing in order to fix the inconsistencies, and to make the metamodel usable and optimized
for further used in an Eclipse/Java/EMF environment and for model transformation rules development.
Schema Inconsistencies
- Remove unused classes: UNIONVALUE
- Remove duplicated reference TableKey.tableRowSnref
- Bring back SuperTypes: Sd -> SpecialData, SimpleValue -> BaseValue
- Some classes should inherit from ODXLink: ComparamRef, DynEndDopRef, LinkComparamRef, ParentRef, PreConsitionStateRef, RelatedDiagCommRef, StateTransitionRef
Metamodel Optimizations
- Switch root container from DocumentRoot to ODX and Catalog (packaged)
- CamelCase naming conventions (based on XML tags) for all ModelElement names: e.g. COMPARAMSUBSET becomes ComparamSubset
- Remove XHTML classes, add Description.xhtml attribute and handle XHTML expressions as-is: B, Br, I, Li, Ol, P, Sub, Sup, U, Ul
- Create abstract super classes to host the most common structural features (see Common Structural Features)
- Update type of group structural features (see Group Types)
- Add derived ODXLink.linkTarget reference to ODXCategory
- Add derived File.odx reference to ODX (package index)
- Simplify all multi-valued classes (being a list container only): e.g. COMPARAMSPEC.pROTSTACKS:PROTSTACKS.pROTSTACK:PROTSTACK replaced by ComparamSpec.protStacks:ProtStack
Here is another example of multi-valued simplification:
Common Structural Features
In order to ease ODX model handling and to make rule development more efficient, a set of abstract classes have been added,
which role is to factorize and host the most common attributes and references.
The name of all those classes starts with ODX prefix and ends with Object suffix.
- ODXNamedObject, shortName attribute (simplify 70 occurrences)
- ODXInvariantIdentifiedObject, oid attribute, inherits from ODXNamedObject (simplify 55 occurrences)
- ODXIdentifiedObject, id attribute, inherits from ODXInvariantIdentifiedObject (simplify 48 occurrences)
- ODXDescribedObject, desc reference (simplify 74 occurrences)
- ODXLongNamedObject, longName reference, inherits from ODXDescribedObject (simplify 68 occurrences)
- ODXExtensibleObject, sdgs reference (simplify 27 occurrences)
- ODXAdministrativeObject, adminData reference (simplify 18 occurrences)
- ODXAudienceObject, audience reference (simplify 9 occurrences)
ODXIdentifiedObject is also referenced by ODXLink to point to the right identified object.
Group Types
Some classes have a group attribute which multiplicity is * and which type is several possible subtypes.
In parallel, the same class has derived references to each of the subtypes.
So, when the order is significant, the group attribute is translated to a reference which type is an existing super type,
while the other references to subtypes are kept as derived references.
If the reference is not ordered (unsignificant order), and if the super type is not existing,
then references to subtypes are set to be non-derived.
- ComplexComparam.baseComparam:BaseComparam reference, .comparam:Comparam and .comparamSubset:ComparamSubset derived references
- ComplexValue.baseValue:BaseValue reference, .simpleValue:SimpleValue and .complexValue:ComplexValue derived references
- Sdg.specialData:SpecialData reference, .sd:Sd and .sdg:Sdg derived references
- Dtcs, .dtc:Dtcd and .dtcRef:ODXLink non-derived references
- DiagVariables, .diagVariable:DiagVariable and .diagVariableRef:ODXLink non-derived references
- InParamIfRefs, .inParamIfSnref:Snref and .inParamIfSnpathref:Snpathref non-derived references
- OutParamIfRefs, .outParamIfSnref:Snref and .outParamIfSnpathref:Snpathref non-derived references
- DiagComms.diagcommproxy reference, .diagService:DiagService, .diagCommRef:ODXLink and .singleEcuJob:SingleEcuJob non-derived references
- Table.rowwrapper reference, .tableRow:TableRow and .tableRowRef:ODXLink non-derived references
- SelectionTableRefs, .selectionTableRef:ODXLink and .selectionTableSnref:Snref non-derived references
Model Edition Customizations
- Display ASAM icon on ODX and Catalog root containers
- Implementation of some toString() methods, when no (anonymous) on non relevant displayed attribute
- Display Description.xhtml and InternFlashdata.data attributes in multi-line mode
Miscellaneous
The value (byte array) of the attributes typed HexBinary are handled in the reader and writer connectors.
The V and Vt classes cannot be optimized and must be preserved,
otherwise there is no way to make the distinction between 0 default value (unset) and explicit 0 value (set to default).