Subject: Re: [netmod] netmod Digest, Vol 2, Issue 23

From: "Gerhard Muenz" <[email-masked]>
Date: Thu, 15 May 2008 21:36:13 +0200 (CEST)

Hi,

My 5 cents:

Honestly, I was a little bit shocked when I read that YANG should allow
alternatives for specifying exactly the same thing, such as "mandatory
true" and "min-elements 1". This is one of the most terrible properties of
XSD.

I would opt for keeping YANG concise and neat. If I write a YANG document,
I can very quickly find the valid attributes for each keyword in the
language specification. Being offered alternatives here would confuse me.

Concerning containers: It's a simple rule that containers cannot be
mandatory. After I understood this rule, it was not a problem at all when
I designed my model. Maybe, it even made me writing a better model than I
would have done otherwise.

However, if you explicitly want to enforce an empty <search-matches/> in
your example, you can specify this with YANG:

    output {
       choice search-type {
          case no-result {
             leaf search-matches {
                type empty;
             }
          }
          case a-result {
             container search-matches {
                choice search-type {
                ...
                }
             }
          }
       }
    }

Hopefully, there is no error in my YANG code ;) I'm a little bit out of
practice.

Regards,
Gerhard

Andy Bierman wrote:
> Phil Shafer wrote:
>> Andy Bierman writes:
>>>> If it's empty and not a presense container, then it carries
>>>> no useful information.  Why would it be mandatory?
>>> IMO, that is up to the data model write.
>>
>> No, if it doesn't make sense, it's up to us to forbid it
>> and avoid the confusion of meaningless YANG (and content).
>>
>
> IMO, the concept of mandatory true/false is useful and
> simple to understand.  I do not agree it is meaningless.
> I prefer this simple clause to 'must' and 'presence' and 'min-elements'.
> I don't really care that much, though.  (I already have a YANG cheat sheet
> to remind of of all the little quirks and details -- it's almost
> as bad as XSD in that regard ;-)
>
>>> It is just as valid to give the manager a stable 'search-matches'
>>> node in the reply as to leave it out.
>>
>> If it's just as valid to leave it out, why would you want to make
>> it mandatory?
>>
>>> Most DML features are very subjective in nature.
>>
>> Sorry, but you are trying to give the writer two choices, one
>> that context sensitive and one that's not so meaningful but
>> less context dependent.  I don't see why we'd allow the writer
>> this choice, given that readers and clarity are more important
>> that a writer that wants to be context insensitive.  Why would
>> the writer need or want this choice?
>>
>> Yes, design work is subjective and there are many right answers,
>> but there are also many wrong ones.  Consider:
>>
>> http://www.8sharp.com/inspired/images/norman_book.jpg
>> http://snarfd.com/wp-content/uploads/2007/11/sorapot_white.jpg
>>
>> Language design is subjective, but every feature needs a semi-objective
>> cost/benefit analysis to see if it's worth inclusion in the language.
>> Here I see the cost but don't see the benefit.  I have a hard time
>> with The idea of helping writers that want to say "mandatory true"
>> instead of "min-elements 1" because they don't want to think about
>> if they are inside a list or not.
>
>
> I think it matters more to the readers than the writer of the module.
>
> I will let this thread go.  I think some other WG members
> (besides the YANG co-authors) should get involved and express
> their opinions.  (If not, then why didn't we just publish YANG
> as Experimental a year ago?)
>
>
>>
>> Thanks,
>>  Phil
>>
>>
>>
>
> Andy

-- 
Dipl.-Ing. Gerhard Münz
Computer Networks and Internet
Wilhelm Schickard Institute for Computer Science
University of Tuebingen
Sand 13 (Room B309), D-72076 Tuebingen, Germany
Phone:  +49 7071 29-70534       Fax: +49 7071 29-5220
E-mail: [email-masked]
WWW:    http://net.informatik.uni-tuebingen.de/~muenz

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: "Gerhard Muenz" <[email-masked]>
Date: Thu, 15 May 2008 21:36:41 +0200 (CEST)

Hi,

My 5 cents:

    output {
       choice search-type {
          case no-result {
             leaf search-matches {
                type empty;
             }
          }
          case a-result {

Regards,
Gerhard