odpi / egeria

Egeria core
https://egeria-project.org
Apache License 2.0
809 stars 261 forks source link

Clean up schema model #1669

Closed mandy-chessell closed 5 years ago

mandy-chessell commented 5 years ago

In the meeting last week we discussed some changes to the schema definitions. This issue tracks the implementation of the decisions:

Remove duplicate attribute definitions

The DerivedSchemaAttribute entity replicated some of the attributes already defined in its superclass SchemaAttribute. These duplicate attributes have been removed because they are unnecessary. However it was pleasing to note that the duplicate definitions caused no problems as it means we can redefine an attribute at a higher level in the inheritance hierarchy without breaking backward compatibility.

Use existing properties

There was also duplication in the properties of these entities with other elements of the model and we agreed that id, comment and aggregatingFunction should be deprecated to use qualifiedName, Comment and formula respectively. Since we do not have the deprecating function in the OMRS type system yet, I have left the properties defined and changed their descriptions to include "deprecated" like this

        final String attribute1Name            = "formula";
        final String attribute1Description     = "Transformation used to create the derived data.";
        final String attribute1DescriptionGUID = null;
        final String attribute2Name            = "comment";
        final String attribute2Description     = "Comment from source system (deprecated).";
        final String attribute2DescriptionGUID = null;
        final String attribute3Name            = "id";
        final String attribute3Description     = "Id of derived schema attribute (deprecated).";
        final String attribute3DescriptionGUID = null;
        final String attribute4Name            = "aggregatingFunction";
        final String attribute4Description     = "Aggregating function of derived schema attribute (deprecated).";
        final String attribute4DescriptionGUID = null;

Simplify TypeEmbeddedAttribute classification

We agreed that the TypeEmbeddedAttribute classification is only a stub for special nesting cases and it does not need the attributes for a fully fledged SchemaType so it is reduced to two attributes: encodingStandard and dataType.

Resulting UML

The UML models look like this now - note it does not show the deprecated fields: 0505-Schema-Attributes

0512-Derived-Schema-Elements

mandy-chessell commented 5 years ago

Consistent use of displayName

We also discussed why SchemaType had an attribute called displayName and SchemaAttribute had an attribute called name. We agreed to go with displayName and move the definition of it (and description) to their joint superclass of SchemaElement.

The name property in SchemaAttribute has been left and marked deprecated in the description as above.

It looks like this: 0501-Schema-Elements

Consistent linkage for SchemaTypeImplementation relationship

The SchemaTypeImplementation relationship used to connect a SchemaType to a Referenceable. This is inconsistent with other uses and so it has been changed to link SchemaType to Process.

mandy-chessell commented 5 years ago

0504-Implementation-Snippets

cong78 commented 5 years ago

Hi Mandy just wondering would we keep the Deprecated in the description after the proper versioning of OM types?

mandy-chessell commented 5 years ago

The verisoning has always been there - just no support for deprecation. There is a separate issue to add the deprecation support. The deprecation will add a field to various parts of the type definition. However, I think updating the description is also helpful.