OASIS TC Open Repository: Manages TOSCA profiles, tests, and templates that are maintained by the TOSCA community. They are intended to be used as examples to help developers get started with TOSCA and to test compliance of TOSCA implementations with the standard.
In TOSCA 1.3 the occurrences keyname has an implied default of [ 1, 1 ]. We've carried this over in TOSCA 2.0 with the new name of count_range.
I don't think this is the right default. As it stands, it means that we believe that in most cases users intend a requirement to result in exactly one relationship. Moreover, it has an important side effect: if users do not assign any requirement at the node template then one will be assigned automatically for them. It means that if users simply write a requirement definition without paying attention to the counting keynames then node templates would all get a requirement assignment.
Automatic assignment is a very useful feature, which I fully support and proposed, but the question is whether it's what users intend if they don't specify the counting keynames. I've found that for the vast majority of my requirement definitions I have to explicitly set count_range to [ 0, UNBOUNDED ] or [ 0, 1 ] to avoid automatic assignment.
I think the reasonable default behavior for a requirement definition should be: assign it as many times as you want, and don't assign it if you don't want. Meaning: [ 0, UNBOUNDED ]. Automatic assignment should be an "opt in" feature. If a profile designer wants that to happen then they should set the lower bound of count_range to 1 or more.
In TOSCA 1.3 the
occurrences
keyname has an implied default of [ 1, 1 ]. We've carried this over in TOSCA 2.0 with the new name ofcount_range
.I don't think this is the right default. As it stands, it means that we believe that in most cases users intend a requirement to result in exactly one relationship. Moreover, it has an important side effect: if users do not assign any requirement at the node template then one will be assigned automatically for them. It means that if users simply write a requirement definition without paying attention to the counting keynames then node templates would all get a requirement assignment.
Automatic assignment is a very useful feature, which I fully support and proposed, but the question is whether it's what users intend if they don't specify the counting keynames. I've found that for the vast majority of my requirement definitions I have to explicitly set
count_range
to [ 0, UNBOUNDED ] or [ 0, 1 ] to avoid automatic assignment.I think the reasonable default behavior for a requirement definition should be: assign it as many times as you want, and don't assign it if you don't want. Meaning: [ 0, UNBOUNDED ]. Automatic assignment should be an "opt in" feature. If a profile designer wants that to happen then they should set the lower bound of
count_range
to 1 or more.