public
public copied to clipboard
list pattern
Hello,
I have question regarding OC data model structure. Why do you use list
pattern like this:
list interface {
key "name";
leaf name {
type leafref {
path "../config/name";
}
}
container config {
uses interface;
}
container state {
uses interface;
}
}
instead of this
list interface {
key "name";
uses interface;
container state {
uses interface;
}
}
I guess the second case is more simple to read and probably more simple for application processing (e.g. validation).
In the second case, the list
contains config elements (without container config
) and container state
for state elements. It has the same information and reuse like first pattern, but you get rid of leafref
. Or is there any other reason I have missed? Maybe you really want to have config
keyword in the datamodel? Thanks for feedback.