mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
528 stars 342 forks source link

UML Plugin: Fix direction of the generalization and realization versions of th uses relation #888

Closed nkhancock closed 4 months ago

nkhancock commented 5 months ago

When using the UML option --uml-uses=generalization or --uml-uses=realization added with PR #868, the generalization or realization relation is rendered the wrong way around.

Assuming that a grouping is considered an abstract class (superclass), then the class which includes the uses statement can be considered the subclass of this abstract class (the grouping) and thus a generalization relation should define a path from the subclass to the superclass with the hollow triangle at the end of the path where it meets the more general superclass.

The following example illustrate what has been fixed.

The YANG data model used to test this fix ``` module test-uses-grouping { namespace "http://www.example.com/ns/yang/my-uses-module-1"; prefix tst-uses-grp; revision 2024-01-31 { description "Initial revision."; reference "None."; } grouping grouping { description "A grouping."; leaf a-leaf { type string; description "A leaf."; } } container container { description "A container."; uses grouping; } } ```

Example

Before the fix:

image image

After the fix:

image image