Subject: [yang-doctors] Identities vs Choice statement

From: Mahesh Jethanandani <[email-masked]>
Date: Mon, 25 Sep 2017 18:44:18 -0700

What are the advantages/disadvantages of using identities vs choice statement?

Background info: There is no central authority on options that can be defined as part of the statement. While the model will define a set of options, extensibility is important. Also, assume that the options are mutually exclusive. The entity being defined is an action, which could be considered abstract, and is not of a particular type, but is scoped locally, and at least at this point does not need to be globally unique.

How would doctors model this?

Mahesh Jethanandani
[email-masked]

---

From: Andy Bierman <[email-masked]>
Date: Mon, 25 Sep 2017 18:53:32 -0700

Hi,

An identityref is a leaf or leaf-list set to an extensible codepoint.

A choice allows multiple cases, and each case is a set of multiple objects,
not just 1 object for the identity.  So YANG knows that if you pick case
foo,
then all the nodes in case foo are available.

For identities, you could put a when-stmt on other objects associated with
the
conceptual case-stmt represented by picking "when identity A", etc.

I think either approach is OK.

Andy

On Mon, Sep 25, 2017 at 6:44 PM, Mahesh Jethanandani <
[email-masked]> wrote:

> Background info: There is no central authority on options that can be
> defined as part of the statement. While the model will define a set of
> options, extensibility is important. Also, assume that the options are
> mutually exclusive. The entity being defined is an action, which could be
> considered abstract, and is not of a particular type, but is scoped
> locally, and at least at this point does not need to be globally unique.
>
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors
>