Re: [yang-doctors] Identities vs enums

Ladislav Lhotka <lhotka@nic.cz> Thu, 29 August 2019 11:11 UTC

Return-Path: <lhotka@nic.cz>
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 01B3312010D for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 04:11:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.998
X-Spam-Level:
X-Spam-Status: No, score=-6.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 pVKiD64mGpG1 for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 04:11:16 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 02E4B1200F4 for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 04:11:16 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a744:2697:a0ec:a420]) by mail.nic.cz (Postfix) with ESMTPSA id D4648140CE7 for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 13:11:13 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1567077073; bh=dheJR5wi4pMUL0k/hrHUL7N/jA3CQilnPkGdMncbpzo=; h=From:To:Date; b=PN05SkqpYhCnKqc+CxnqzwTuvvgrwX9u87179xK78xHQz3Cgb0brqnbS248Wa20X6 pDXQY8aSS95z2OktQDIehKhi8xcPP8VfDvXc3MlTF9GuEXSenyWwcz6BJ2pGafJWc7 idFViaXXlZ6+/R2IumpcN6QAPHLQEZbQ8TAYN+fg=
Message-ID: <c0c6bb8f1fe8ebe910c09ff764f43a2d84907d42.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: yang-doctors@ietf.org
Date: Thu, 29 Aug 2019 13:11:13 +0200
In-Reply-To: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
References: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.32.4
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/6est3jzMcgiYx9rKIQTfPVT1tUE>
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 11:11:18 -0000

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).

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.

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