Details
-
Improvement
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
Description
The model API's interface class hierarchy regarding types is confusing for users. There are three basic concepts, which are intertwined:
TypeDefinition, which is the top-level interface
ExtendedType, which is a public non-final class implementing it
DerivedType, which is an attempt to clean up TypeDefiniton and ExtendedType relationship.
This is not accurate as to what is actually going on, what we really have are two sets of interfaces:
1) TypeSemantics, which equals TypeDefinition without getBaseType(), and defines the basic semantic group (integer, string, etc.), but not things like range of allowed values.
2) TypeDefinition, which defines the actual type, with ranges and other restrictions. It also provides a getTypeSemantics() method, which returns a TypeSemantics which this particular TypeDefinition follows.
There is also a DerivedTypeDefinition, which is a subclass of TypeDefinition, which adds a getSuperType() method – this returns the TypeDefinition from which this type is derived.
All user-defined types implement DerivedTypeDefinition. All built-in types implement TypeDefinition only.
This is a strawman proposal, which needs to be fleshed out, especially the individual concepts need to be made clear.
Attachments
Issue Links
- is blocked by
-
YANGTOOLS-547 yang-model-util: Cleanup TypeDefinition implemenetation
- Resolved