Refactor/model impl ontology#45
Merged
Merged
Conversation
Phase 1 — Eliminate YangBuiltInStatementImpl: - Move builtinEquals() to YangBuiltinStatement default method - Add instanceof guard in YangStatementImpl.initSelf() for auto substatement validation on all YangBuiltinStatement instances - Delete YangBuiltInStatementImpl class entirely - Flatten ~47 subclasses to extend YangStatementImpl directly Phase 2 — SchemaNodeImpl → SchemaNodeSupport (composition): - Extract SchemaNodeImpl into SchemaNodeSupport composition class (SchemaNode is a role/contract, not a YANG statement ontology) - All 6 intermediate abstract classes now extend EntityImpl and compose SchemaNodeSupport via delegation - SchemaNode contract methods delegate through schemaNodeSupport Result: ontology chain (YangStatement → Entity → DataDefinition → Container/Leaf/...) cleanly separated from role contracts (SchemaNode, YangBuiltinStatement). 521 tests pass, zero regression. Co-Authored-By: lllyfeng <fengchongllly@gmail.com>
…upport YangDataStructureImpl and AugmentStructureImpl now extend EntityImpl (instead of SchemaNodeImpl) and compose SchemaNodeSupport for SchemaNode contract methods. This keeps SchemaNode as a clean role rather than an ontology node, consistent with Phase 2 refactoring. Also add model-impl unit tests for: - YangBuiltinStatement.validateSubStatements() and builtinEquals() - SchemaNodeSupport delegation methods Co-Authored-By: lllyfeng <fengchongllly@gmail.com>
…odeSupport - YangBuiltinStatementTest: validates builtinEquals() contract and validateSubStatements() default method work regardless of inheritance chain - SchemaNodeSupportTest: validates SchemaNode delegation methods (supported, isMandatory, hasDefault, isAncestorNode, setDeviated, etc.) Co-Authored-By: lllyfeng <fengchongllly@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.