Skip to content

Constraints rules for NcDatatypeDescriptorStruct and associated NcFieldDescriptor need clarification #61

@jonathan-r-thorpe

Description

@jonathan-r-thorpe

In the case where a vendor has specified their own non-standard struct datatype, they have the opportunity to define NcParameterConstraints at the struct level, but can also define a NcParameterConstraint for each NcFieldDescriptor contained in the NcDatatypeDescriptorStruct definition.

This creates a potential conflict not covered by the specification.

Firstly a NcDatatypeDescriptorStruct can only meaningfully have a NcParameterConstraint containing a default value only (NcParameterConstraintNumber and NcParameterConstraintString are not applicable).

But if each of the contained NcFieldDescriptors also have constraints, which could possibly be NcParameterConstraintNumber or NcParameterConstraintString how do we reconcile the constraints?

Merging of the constraints at the struct and field level seems to be be against the maxim of "multiple levels of constraints implementations MUST fully override the previous level", even thought struct and field levels aren't explicitly mentioned in the current specification.

For the datatype definition my suggestion is that we only allow constraints at EITHER the struct level OR the field level.

There is then the question of whether struct properties with field level constraints can be overridden by property or runtime constraints. Given the property and runtime constraints can only override at the struct level, they cannot override at a field level and so should not be allowed i.e. struct datatypes with field level constraints CANNOT be overridden by property constraints or runtime constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions