Subject: Re: [netmod] Additional substatements in groupings

From: "Linowski, Bernd (EXT-Other - DE/Dusseldorf)" <[email-masked]>
Date: Wed, 15 Oct 2008 18:37:02 +0300

(Second try - now with correct from- and to address. There were some
mail delivery failures.
If you have received this mail already, you can ignore the previous one
as this contains the same text)

Hi,

Balazs Lengyel wrote:
> Hello,
> I wanted to use a grouping as a kind-of complex type. 

This is really useful for the mapping of
one of our CM modeling languages to YANG.

> I ran 
> into the problem that the list of 
> substatements inside a grouping is rather limited.
> Why can't we use the following statements directly under a grouping?
> - key  (need it !!!)

Yes! Otherwise it is impossible to define a reusable grouping that
could serve as complete template for defining data nodes, especially
lists.

> - mandatory
Hmm, what about the case where groupings with "mandatory true;" as
direct substatement
is used inside an augment statement? Shouldn't that be disallowed?

> - min-elements   (need it !!!)
> - max-elements  (need it !!!)
> - config
> - type
Need it!

> 
> Generally:
> IMHO the main aim of a grouping is to be meaningful and 
> correct ONCE IT HAS BEEN PUT INTO A USES.
> Validation of a grouping itself should only complain about 
> things, that can in no way be 
> correct with any kind of uses statement.

Absolutely agree! 

Recently I was prototyping the mapping of a NSN CM modeling
language to YANG and also realized that the usability of
groupings is substanially impaired by not being able
to use key, config, min/max-elements inside the grouping, 
as this are quite fundamental properties of a data-node.

Best wishes,
Bernd

> That means nearly 
> all statements could be allowed 
> inside a grouping with some exceptions e.g. module, submodule.
> 
> All the above statements can perfectly fulfill this 
> requirement. E.g. the following examples 
> make perfect sense for me:
> 
> grouping foo {
>      key id;
>      leaf id;
> }
> 
> list myFooList {
>     uses foo;
> }
> 
> Or if a set of modules all reference the same set of other modules:
> 
> grouping commonImports {
>     import yang-types {..}
>     import inet-types {...}
>     import ieee-types {...}
>     import ericssonTypes {...}
>     import ericssonExtensions {...}
>     import tpsPlatformBaseStuff {...}		
> }
> 
> module oneOfManyModules {
>      uses commonImports;
> }
> 
> Balazs
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
> 
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod