Hello William,

oh, thank you for pointing that out.  I wasn't aware that it is allowed
to replace existing data definition nodes with a grouping and put a
"uses" statement instead in an update of the module.

In that case, if you wanted to reuse a definition, you would however
still not be able to simply reuse what is there.  You would need to
update the module (whose definitions you wanted to use/embed) first,
only then be able to reuse it.  Still, it would provide the option to
refactor existing module definitions with groupings/uses, then use those
groupings in the new definitions (that would otherwise need to embed).  
This could be done with the existing means (hidden as they may be -
perhaps needing to be called out as a "best practice" or "design
pattern" or such).

Would we in that case even still need a new embed substatement? (IMHO in
the longer term it would be desirable to be able to reuse without
needing to update existing module definitions with equivalent ones. 
Although as you point out that is possible, it seems a bit awkward.  I
guess the question is if or when YANG-next is going to happen and if a
new construct is needed in the interim.)

--- Alex

On 8/1/2024 1:21 AM, William Lupton wrote:
Alex,

On Wed, 31 Jul 2024 at 23:37, Alexander L Clemm
<[email protected]> wrote:

    ...
    >> As a thought, it might be useful to introduce a construct that
    will allow to define
    >> a _grouping_ after-the-fact, for later reuse. I.e., allow
    groupings to be defined
    >> in a way that the new grouping embeds an existing definition,
    then simply make
    >> use of that grouping.  That would seem perhaps cleanest, able
    to address many
    >> of the use cases and have the additional advantage that the
    semantics here will
    >> be very clear since part of the exising YANG framework.
    > There is still the augment issue from above, we have it in
    draft-ietf-opsawg-collected-data-manifest when reusing
    ietf-yang-push which augments ietf-subscribed-notifications. All
    these augments have to be rewritten with paths corresponding to
    the new location of the uses.
    <AC> I don't think that would be an issue, actually. Just declare
    modular, fine grained groupings and use those.  Of course, this is
    somewhat a speculative discussion as YANG is what it is and does not
    support this today.


<WL>
What does "this" refer to here? YANG _does_ "allow groupings to be
defined in a way that the new grouping embeds an existing definition",
doesn't it?

https://datatracker.ietf.org/doc/html/rfc7950#section-11 : Any set of
data definition nodes may be replaced with another set of
syntactically and semantically equivalent nodes. For example, a set of
leafs may be replaced by a "uses" statement of a grouping with the
same leafs.
</WL>

Cheeers,
William

_______________________________________________
netmod mailing list [email protected]
To unsubscribe send an email [email protected]
_______________________________________________
netmod mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to