Juergen Schoenwaelder <[email protected]> wrote:
> On Thu, Apr 16, 2015 at 09:02:32AM +0200, Martin Bjorklund wrote:
> > Juergen Schoenwaelder <[email protected]> wrote:
> > > I think some thought should also be given to simplify the references.
> > > Right now, in order to refer to a termination point, I have to use a
> > > triple (network-ref, node-ref, tp-ref). Have you considered using an
> > > instance-identifier with require-instance instead? One option would be
> > > to define proper typedefs such as
> > > 
> > >    typedef tp-ref {
> > >      type instance-identifier { require-instance }
> > >      description
> > >        "An instance identifier refering to a termination point."
> > >    }
> > > 
> > > and then things can be collapsed. One would likely do the same for
> > > other model elements, that is introduce typdefs for node-ref, link-ref
> > > network-ref. This will make the tree much more compact.
> > 
> > There are two drawbacks with this scheme.  First, the model is less
> > precise.  An instance-identifier can refer to anything, and there is
> > not formal constraint in the model to restrict it to a termination
> > point.
> 
> Hence you wrap it in a typedef with an appropriate description clause.
> And by using the typedef, the model actually becomes more readable.

I think you get the same effect (readable model) by using groupings.

> > Second, even if the data model becomes more compact, the
> > instance data with an instance-identifier is more verbose and maybe
> > harder to read for an operator (less "direct").
> 
> I love to hear from operators that they find
> 
>   /nt:network[foo]/nt:node[bar]/nt:termination-point[baz]
> 
> more complicated than this:
> 
>   
> <nt:network-ref>foo</nt:network-ref><nt:node-ref>bar</nt:node-ref><nt:termination-point>baz</nt:termination-point>


This would be (XML):

  
/nd:network[nd:network-id="foo"]/nd:node[nd:node-id="bar"]/nt:termination-point[nt:tp-id="baz"]

Compared with:

  <network-ref>foo</network-ref>
  <node-ref>bar</node-ref>
  <termination-point>baz</termination-point>

Or in JSON:

  
/ietf-network:network-id[network-id="foo"]/node[node-id="bar"]/ietf-network-topology:termination-point[tp-id="baz"]

Compared with:

  "network-ref": "foo",
  "node-ref": "bar",
  "termination-point": "baz"


But yes, which one is easier to read and write is subjective.



/martin

_______________________________________________
i2rs mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/i2rs

Reply via email to