Re: [yang-doctors] Design pattern: Reusable types in type specific modules

Ebben Aries <exa@juniper.net> Tue, 19 March 2024 06:59 UTC

Return-Path: <exa@juniper.net>
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 46D44C14F682; Mon, 18 Mar 2024 23:59:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.106
X-Spam-Level:
X-Spam-Status: No, score=-7.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=juniper.net header.b="TCo74kK9"; dkim=pass (1024-bit key) header.d=juniper.net header.b="lEYFTOou"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pZ9vUb6IpOHy; Mon, 18 Mar 2024 23:59:14 -0700 (PDT)
Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (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 42242C14F61A; Mon, 18 Mar 2024 23:59:14 -0700 (PDT)
Received: from pps.filterd (m0108159.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42INSdj2022923; Mon, 18 Mar 2024 23:59:14 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h= date:from:to:cc:subject:message-id:references:content-type :content-transfer-encoding:in-reply-to:mime-version; s=PPS1017; bh=mTICjpSb0ZJ4Bkwtf1pFf0danGqZ8K/xGbw9/GQRMQ8=; b=TCo74kK9yS/Q N+jnSOqu5WZgL4h0OYmg9FzMzJDrf9UxTvUETE7/STbDlWQgISa4eBcFhm0mePH0 Rsz2gw3FCxy3wP89Kb6fVA3qSEPKMwcfHJtWuTu2OhD/+HEkJ0vVTNQtQtmtWEOy pWrBGk6r5NrIBWGG3ffOHMUGPXYZU0SCmDPUa0+DBkGajUt9niHp4DT7LtDunoir qkGP/I7kh6cXcigI3V5yOHLmsLFUn8wX8Q/jEOx/2KEuRyS+fRdqvSqvJWUa5H/B kR+V1/hQii4hLoWf8HN9fffdleFC4a03eOr1gJNCSfx4g24RQSYBtOarYFKI42Fk OPWUHJF1YA==
Received: from co1pr03cu002.outbound.protection.outlook.com (mail-westus2azlp17014040.outbound.protection.outlook.com [40.93.10.40]) by mx0a-00273201.pphosted.com (PPS) with ESMTPS id 3ww9cs4ehq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Mar 2024 23:59:13 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVxjQTrEIxXfrJl1keZdUPiOWy/8ihecBdrVjF+1q6l3JjBIrYIaDcDSoQLIb0vTmIcWwJhfnU+Yo6uxT/2KgAO2211QyXsZQ9aeU+WljzxoyB/Mt4I6W4JtGy5/vd0N+ucp08L/RkKj7TIPgQPPsb9kUgZzq9nNlV6wxTUwj+TrH7A/U8aqp+OFH5Evlh2veJL06jApg3OT5kHDJksyYgaEDiRvq0ett+uVKMx8Ohg8FwwQTajSrI6AJGYw6DB0ZOLTcbXvGvUS+xXPWhYsIC4xfj+Z9Px4BwUIkDWhyHQTJqlp98jHBwrqt+rgsCvNRFCb+PPIljGPznx/GTcPzA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mTICjpSb0ZJ4Bkwtf1pFf0danGqZ8K/xGbw9/GQRMQ8=; b=GZAhZlKEQFPV+UO9gBnu82ZXUrNu+69XOuqA4ZPI9XMHdUaCAvuesic8j4MwrTmhqqCJ10jMdgRSwShO7arJ1+eM++uL4BsnABugnmB1WygaTMLZxRjRvkiCjbHv4utIyS2hy9CCzaoZvzWo5xLXg92w4D6+6T8qjVW8/8uVxcumRX8cxKkdO07xrb/gHmD8ARDO3j0azXYo2oC9v5pX7YtvRwMC4O//S8WISoUdcoTkNpnIl1GtZqycV5eO31jVh6jRo6YXVZik/46f1ayBgykmwb65ZMlO5wM8IKgPYr2jxM19PYE+0oSC/pJN6FYJin/GUFXFewm0gQhT9lJRaA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=juniper.net; dmarc=pass action=none header.from=juniper.net; dkim=pass header.d=juniper.net; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mTICjpSb0ZJ4Bkwtf1pFf0danGqZ8K/xGbw9/GQRMQ8=; b=lEYFTOou7874i/aZ/B5GbnHPt83tmB1RxyIkgJdKEvb3ahCF3NqYYKuTjmpbvosi0t6JmIfD7jsxK/jRd97n1/9rNLrV0RFUWkw9Z1JiWpEd+DOrsMEiafB/1CQSgR3t1svMbdsuQ0OrVQR3gf8BIuJwW6EI3dKbgfjxVyUkVis=
Received: from CH3PR05MB10076.namprd05.prod.outlook.com (2603:10b6:610:12d::22) by PH0PR05MB7783.namprd05.prod.outlook.com (2603:10b6:510:2d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27; Tue, 19 Mar 2024 06:59:09 +0000
Received: from CH3PR05MB10076.namprd05.prod.outlook.com ([fe80::49e6:ae6a:45c:c5ac]) by CH3PR05MB10076.namprd05.prod.outlook.com ([fe80::49e6:ae6a:45c:c5ac%4]) with mapi id 15.20.7386.025; Tue, 19 Mar 2024 06:59:08 +0000
Date: Tue, 19 Mar 2024 16:59:03 +1000
From: Ebben Aries <exa@juniper.net>
To: Kent Watsen <kent@watsen.net>
Cc: Ebben Aries <exa=40juniper.net@dmarc.ietf.org>, YANG Doctors <yang-doctors@ietf.org>
Message-ID: <Zfk3t8I9AAViqEuU@localhost>
References: <ZcZQ2LpbVFui9IB-@localhost> <0100018defc8c76a-839ae33f-2033-4336-9438-eb317817e12f-000000@email.amazonses.com>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <0100018defc8c76a-839ae33f-2033-4336-9438-eb317817e12f-000000@email.amazonses.com>
X-ClientProxiedBy: CY5PR22CA0035.namprd22.prod.outlook.com (2603:10b6:930:1d::11) To CH3PR05MB10076.namprd05.prod.outlook.com (2603:10b6:610:12d::22)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PR05MB10076:EE_|PH0PR05MB7783:EE_
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: SoJBN+GQc6+EhpU+qzr7bYDal1HeSXuaJPWNVq8jvxjt6DzYz41OsAfVKJDASKuLlC/pZSb5iy1tdoQKgCp+syk5EwaFCVNx4T7HDAAxKa84qM8uQtA1aTAW1WjJctdF5hN8I7bGpw0SVGIRy81nn26LSQIF1XvM4uTeejcrOn+3F+VX2zjKJyN+W9oLWDod04Buw6VWBfjMKgojM9AWB/rkKeT44vlIRCGQkopqQE/+n8uuMtdx9Dn31CTKuw0l25bNUL/d6Y2CS/Vm4bD1U5JZsJCy8RJ/kzzR7NqCSYM9eMiOo/46WTACEU+8j06nV9ISEsCW+m48ZGDQo+FgQieDWqXOWublCR7Snl+Q2dK9DczE2VbyGd3Tv0omcru3yTfOi8AaKPzenOnOz9CQfO5mbwFr6AGRwto4k0rcwcLT8Zls6VOfeRtcBGMN61givnB3/nAzf1P34384Bj+5TD/S+vbDpjfWTFcPkMFIIFckBL8d4h6WPqTBBzRpdLaEte5httcxHvhG0tlRNIfUG6Gcgs1qG6imKrs9kBTetHSh8lRiG/kICho0ImjjGyijPDj0lBtZt7E0/x9GdgBpHlcbwhwn/tsTn5k6VhYuQKs=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR05MB10076.namprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: xN+5udM+oqbnCZcayoTqXiR116tvdyP8+kaZfZhgblvO8FQWvM57sYqBxm8tkw9yzGnykEIurArjmOuIGmziC1BEKMbf3j8btnoBiHF1VV9Q0tyNOUbFhaDxaCe531K/hu64FDSBcEmJjC49vcYl/mGCtlhBTTvwzJbBSmd1oouXJxMfyY5ZJXKu/Xwzt/XjvtZhPN5pVWa0lXB+qTT4KTLO0sA1VEzI0zqPS7YcWLM2p4/Wt02TBE3ifdblS0RXpr99mUyNY8m0IraR6Q990Y8xSlTklvBgVGNIyNriaxQqI4jcJSZ2Bkdlaz/Iljp2hHVmxD61SRvXx93Cr38drg4p7YreSlflldPWCk7DNx/8X5sQcmo/NiNMMDX07eIl3vMUD593nFeJpNR/1q6z1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ASdjjG6bQ6+977m2UwR7k9zn585Z2KUZ7k4pJG51Yt62OXck/QIqt7xyv8z2/GveDU2EG3YP2om9izd6yu0R4DmhmXGV/hRa6b+2NKm8vUoOH2
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-Network-Message-Id: c4289f95-ff39-43d8-f5e7-08dc47e212e8
X-MS-Exchange-CrossTenant-AuthSource: CH3PR05MB10076.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 06:59:08.7443 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ps8duhB230MFSwvc3R4SCXzVZeEMN8aLpbvhji9Btg30aSgnaVAmg+kZVQCVyt7w
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR05MB7783
X-Proofpoint-ORIG-GUID: mHSHMW0T9iR4PvE4ftv8NjdCPtuw0RG3
X-Proofpoint-GUID: mHSHMW0T9iR4PvE4ftv8NjdCPtuw0RG3
X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-18_12,2024-03-18_03,2023-05-22_02
X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 phishscore=0 clxscore=1011 adultscore=0 suspectscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403190053
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/uThDiJGrvTt2mYn6y_kERtjD3bw>
Subject: Re: [yang-doctors] Design pattern: Reusable types in type specific modules
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.39
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: Tue, 19 Mar 2024 06:59:18 -0000

Thx Kent - it looks as though this introduces another method I didn't
account for.

A module can import these modules, assume the feature you are gating the
data-tree by is _not_ supported, the data-tree is suppressed -
groupings, identities, etc.. can all be leveraged still.  We still fall
into the category of how to express "implement" vs. "import-only" (It
would still fall into the latter category) and thus a reliance on YANG
library support.

If all reusable objects were to be peeled off into their own modules and
anything that defines a base container/list/leaf/leaf-list in others
(using from the distinct "types" modules), we then have a firmer
demarcation reducing the reliance on learning to what extent a module is
supported/not-supported

On 2024-02-28 12:55:29, Kent Watsen wrote:
> [External Email. Be cautious of content]
> 
> 
> Hi Ebben,
> 
> The client-server suite of drafts in NETCONF provide a number of general purpose modules that are expected to be used outside of the original purpose of defining a configuration model for NETCONF and RESTCONF servers.
> 
> My solution is to sprinkle if-feature statements everywhere so that implementations can easily turn off the parts they don’t want.   I hate deviations and hence hope this makes it so they’re unnecessary.
> 
> Hope it helps.
> 
> Kent
> 
> 
> > On Feb 9, 2024, at 11:20 AM, Ebben Aries <exa=40juniper.net@dmarc.ietf.org> wrote:
> >
> > YANG Doctors,
> >
> > I'd like to understand if there has ever been motivation or guidance to
> > model authors to question if any types (typedefs, identities or even
> > groupings) they are bringing into domain specific work are to be
> > used/leveraged outside of the scope of their immediate model work and if
> > it's best to choose an alternate pattern to create domain specific types
> > modules.
> >
> > Outside of the obvious reusable global type modules (ietf-inet-types,
> > ietf-yang-types, ietf-routing-types, etc..), there are many published
> > modules that bring in reusable common types along side data-trees,
> > notifications, rpcs, actions.
> >
> > If another module wants to leverage any such types but the
> > implementation may not support all other constructs, this is where the
> > YANG library implement vs. import-only comes in however to a consumer,
> > this is often not well understood or mandated for workflows.  Another
> > solution here is to produce deviations which give another common
> > misperception and perceived abuse that support is advertised for a model
> > (or set of models due to sometimes vast dependency chains) then
> > completely negated since only a small subset of a type is the
> > dependency.
> >
> > Where do we stand on this topic and have we been nudging any authors to
> > question if their types should indeed get pulled back into specific
> > domain/global types modules?
> >
> > Thx
> >
> > /ebben
> >
> > _______________________________________________
> > yang-doctors mailing list
> > yang-doctors@ietf.org
> > https://urldefense.com/v3/__https://www.ietf.org/mailman/listinfo/yang-doctors__;!!NEt6yMaO-gk!FYlIlfTPQeyXz2LZ2n8GM7dOPThXPRs46H9ZdhVgp3AR1SIcQGcqoZDyM6imaPBQM8mDxcQ68Q$
> 
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://urldefense.com/v3/__https://www.ietf.org/mailman/listinfo/yang-doctors__;!!NEt6yMaO-gk!FYlIlfTPQeyXz2LZ2n8GM7dOPThXPRs46H9ZdhVgp3AR1SIcQGcqoZDyM6imaPBQM8mDxcQ68Q$