[YANGTOOLS-496] yang-model-api: Cleanup TypeDefinition Created: 07/Sep/15 Updated: 10/Apr/22 Resolved: 16/Oct/16 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| 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 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. |
| Comments |
| Comment by Robert Varga [ 18/Nov/15 ] |
|
Length/range constraint clarifications: |
| Comment by Robert Varga [ 08/Jun/16 ] |
|
This has been implemented in model.util.type package. The only remaining task is to remove DerivedType, ExtendedType and all the public base types in model.util. |
| Comment by Robert Varga [ 16/Oct/16 ] |
|
Fixed in Boron. |