Re: [yang-doctors] Identities vs enums

Martin Bjorklund <mbj@tail-f.com> Thu, 29 August 2019 12:12 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8781412083E for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:12:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KNOYJgxPKtgX for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:12:31 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 5503012084D for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 05:12:31 -0700 (PDT)
Received: from localhost (unknown [173.38.220.50]) by mail.tail-f.com (Postfix) with ESMTPSA id DF7311AE08D8; Thu, 29 Aug 2019 14:12:29 +0200 (CEST)
Date: Thu, 29 Aug 2019 14:12:06 +0200 (CEST)
Message-Id: <20190829.141206.1259163418621751811.mbj@tail-f.com>
To: rwilton@cisco.com
Cc: j.schoenwaelder@jacobs-university.de, yang-doctors@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <MN2PR11MB4366B337E1F8EF8BAA3DDB82B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
References: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com> <20190829105312.764zyxjbxbvzmaic@anna.jacobs.jacobs-university.de> <MN2PR11MB4366B337E1F8EF8BAA3DDB82B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/itKrBUxNC2vXxmgy6Iynqizuxgw>
Subject: Re: [yang-doctors] Identities vs enums
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Aug 2019 12:12:45 -0000

"Rob Wilton (rwilton)" <rwilton@cisco.com>; wrote:

[...]

> Yes.  I'm questioning (for a future version of YANG) whether enums
> should have somewhat similar flexibility as identities (yes, I
> appreciate that there are value/name collision concerns).

You can also use a union of an enumeration and an identity.



/martin



> 
> Thanks,
> Rob
> 
> 
> > 
> > /js
> > 
> > On Thu, Aug 29, 2019 at 10:24:59AM +0000, Rob Wilton (rwilton) wrote:
> > > I doubt that this is the first time that this has come up ...
> > >
> > > draft-ietf-netmod-intf-ext-yang-07, defines 3 identities (along with a
> > base identity) for loopback configuration: "loopback-internal",
> > "loopback-
> > line" and "loopback-connector".
> > >
> > > One of the reviewers is complaining that the "loopback-" prefix in the
> > identity is redundant and noisy.  I.e. he doesn't like having to write
> > loopback='loopback-internal', and would like to be able to write
> > loopback='internal' instead.
> > >
> > > His main suggestion is to move these loopback (or perhaps just the
> > identities) to a separate YANG module so that they don't need to
> > define a
> > "loopback-" prefix.
> > >
> > > There seem to be some choices here:
> > >
> > > (1) Keep with identities with a "loopback-" prefix.  This causes
> > loopback='loopback-internal'
> > >
> > > (2) Keep with identities, but loose the common prefix, i.e. the
> > identities become "internal", "line", "connector".  Given the size of
> > the
> > module, the likelihood of an identity naming clash in future seems
> > quite
> > small, but they are somewhat generic terms.
> > > (3) Use shorter identity names, but also put them in a separate types
> > module (as requested by the reviewer).
> > > (4) Use an enum rather than identities.  Although this has the
> > > potential
> > issue that the enum cannot be extended (which I'm wondering if this is
> > something that we should consider changing in the hypothetical YANG
> > Next).
> > >
> > > Personally, I'm toying with changing to 4 or perhaps 2.  I'm not keen
> > > on
> > 3.
> > >
> > > Any thoughts or opinions from the YANG doctors?
> > >
> > > Thanks,
> > > Rob
> > >
> > 
> > > _______________________________________________
> > > yang-doctors mailing list
> > > yang-doctors@ietf.org
> > > https://www.ietf.org/mailman/listinfo/yang-doctors
> > 
> > 
> > --
> > Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> > Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> > Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
> 
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
>