Re: [yang-doctors] Identities vs enums
Martin Bjorklund <mbj@tail-f.com> Thu, 29 August 2019 12:13 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 3AB641200D5 for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:13:59 -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 iQtPy1jWbB4B for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:13:57 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 7059F12010D for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 05:13:57 -0700 (PDT)
Received: from localhost (unknown [173.38.220.50]) by mail.tail-f.com (Postfix) with ESMTPSA id A45341AE08D8; Thu, 29 Aug 2019 14:13:56 +0200 (CEST)
Date: Thu, 29 Aug 2019 14:13:33 +0200
Message-Id: <20190829.141333.409220577655745011.mbj@tail-f.com>
To: lhotka@nic.cz
Cc: yang-doctors@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <c0c6bb8f1fe8ebe910c09ff764f43a2d84907d42.camel@nic.cz>
References: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com> <c0c6bb8f1fe8ebe910c09ff764f43a2d84907d42.camel@nic.cz>
X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/3XqIm4fnvGquruvcne1bTGs9tKU>
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:13:59 -0000
Ladislav Lhotka <lhotka@nic.cz> wrote: > On Thu, 2019-08-29 at 10:24 +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). > > I would go for (2). +1 (provided you really need the flexibility!) > In fact, the namespace for identity names probably needn't be module-wide, I > think it would be perfectly fine to require unique names only for identities > derived from the same base. Yes that would have worked as well. But it would have a big impact on implementations that use the fact that they are unique... /martin > > Lada > > > > > 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 > -- > Ladislav Lhotka > Head, CZ.NIC Labs > PGP Key ID: 0xB8F92B08A9F76C67 > > _______________________________________________ > yang-doctors mailing list > yang-doctors@ietf.org > https://www.ietf.org/mailman/listinfo/yang-doctors
- [yang-doctors] Identities vs enums Rob Wilton (rwilton)
- Re: [yang-doctors] Identities vs enums Juergen Schoenwaelder
- Re: [yang-doctors] Identities vs enums Martin Bjorklund
- Re: [yang-doctors] Identities vs enums Ladislav Lhotka
- Re: [yang-doctors] Identities vs enums Rob Wilton (rwilton)
- Re: [yang-doctors] Identities vs enums Martin Bjorklund
- Re: [yang-doctors] Identities vs enums Ladislav Lhotka
- Re: [yang-doctors] Identities vs enums Reshad Rahman (rrahman)
- Re: [yang-doctors] Identities vs enums Rob Wilton (rwilton)