Hello,
IMO "submodule"s are a striking example of redundant complexity in an
otherwise very close to perfection YANG (regardless if it is YANG 1.0 or
1.1).
Modules and submodules have been around for a while however the ratio of
the currently published modules compared with the submodules is about 40
modules to 1 submodule (if one ignores all the modules and submodules
from particular networking hardware manufacturer that is particularly
keen on using submodules). As a far but still relevant analogy Java has
a limitation of 1 file per class and this atomicity has proven to be an
advantage especially in terms of enforcing modularity. IMO there is
nothing that can be done with the help of submodules that can not be
done without them.
For the sake of the argument can you provide a synthesized description
of the problem that lead you to a drastic solution like "we’ll look at
trying to put everything into submodules in this case."?
Vladimir
On 08/07/2017 04:37 PM, Ivory, William wrote:
Hi Jan,
Thanks – we’ll look at trying to put everything into submodules in
this case.
Regards,
William
*From:*Jan Lindblad [mailto:[email protected]]
*Sent:* 07 August 2017 14:28
*To:* Ivory, William <[email protected]>
*Cc:* [email protected]
*Subject:* Re: [netmod] Query about augmenting module from submodule
in YANG 1.0
The submodule concept in YANG 1.0 is, well, not very useful, and even
less intuitive. That's why it saw major rework in YANG 1.1.
A YANG 1.0 submodule cannot reference the module that includes it,
directly or indirectly. This is because in YANG 1.0 the symbols in
other submodules of the same namespace are invisible to the submodule
unless they are explicitly included. And parent modules can't be
included by a submodule because that would lead to an inclusion loop.
It is possible to reference (augment, etc) other sibling submodules,
though. So if you split your modules cleverly, you might be able to
resolve your referential constraints anyway.
If you really want to take the submodule path, I'd recommend moving to
YANG 1.1. In the interest of preserving the hair tone of IT-architects.
/jan
We’re trying to solve a modularity problem with a YANG module by
splitting it into submodules and augmenting the parent module from
each submodule. However, despite the wording below in YANG 1.0
section 7.15, we’ve found a couple of threads online with comments
suggesting it’s only allowed in YANG 1.1? Would appreciate
clarification.
RFC 6020 section 7.15 suggests it is allowed:
‘
The "augment" statement allows a module or submodule to add to the
schema tree defined in an external module, or the current
module and
its submodules, and to add to the nodes from a grouping in a "uses"
statement.
‘
Versus online comments
here:https://www.ietf.org/mail-archive/web/netmod/current/msg15418.html
<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mail-2Darchive_web_netmod_current_msg15418.html&d=DwMFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=FmJP9CH54z5mG3DFGBdc_9q1TLpYQ31-TQ-26_Qa9vw&m=YC4w6Zi9KhBp0MnnvA42_qdR2aM3uOFWpZYtgF122Ec&s=OxxQRDucETBaDPn4KGNWcLlu4e8AMSfuyJJjrklp3R0&e=>
‘> On 01 Mar 2016, at 10:38, Anton Tkáčik <anton.tkacik at pantheon.tech>
wrote:
>
> Hi,
> Noticed other issue with example set,
> Inhttps://github.com/mbj4668/pyang/issues/194
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mbj4668_pyang_issues_194&d=DwMFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=FmJP9CH54z5mG3DFGBdc_9q1TLpYQ31-TQ-26_Qa9vw&m=YC4w6Zi9KhBp0MnnvA42_qdR2aM3uOFWpZYtgF122Ec&s=bkakKJEZzCBq3BkP5NzW-wDX6KOZHpOnT0u-ySg8rS0&e=>
Lada stated that in YANG 1.0 submodule can not augment nodes
> defined in parent model.
>
> Is that correct that submodule can not augment definition defined in
parent module?
This isn't possible in YANG 1.0 but will be possible in 1.1. However, in
the present case the definition being augmented from the submodule is arguably
in a different module.
Lada
‘
Thanks,
William
_______________________________________________
netmod mailing list
[email protected] <mailto:[email protected]>
https://www.ietf.org/mailman/listinfo/netmod
<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwMFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=FmJP9CH54z5mG3DFGBdc_9q1TLpYQ31-TQ-26_Qa9vw&m=YC4w6Zi9KhBp0MnnvA42_qdR2aM3uOFWpZYtgF122Ec&s=x7sK1jWYtSsQJr8r6G7FjWR5gAoMtgv6zRwxT4bzMGQ&e=>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod