'multiplicity' would seem the right name.
Looks like you're describing the following values:
Mandatory: 1 Optional: 0+ Select All: n
'multiplicity' would seem the right name.
Looks like you're describing the following values:
Mandatory: 1 Optional: 0+ Select All: n
optionality
Mandatory/Optional seems like a boolean whether this is an optional field.
Select All nearly seems unrelated and could be its own property.
NOTE: See EDIT below for a different approach than the one given here
How about requirementConstraint
?
<my:customSelect requirementConstraint="Mandatory">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</my:customSelect>
Another possiblity is not to tri-state the value in the first place. For example, you can instead provide two separate properties: required
("yes" | "no"
), and selectAll
("yes" | "no"
) to make the intent clearer.
EDIT: Actually, I can see how a tri-state might still be useful, if I understand your requirements correctly. Another possibility would be to call the property mustSelect
and make the allowed values one
(mandatory), any
(optional), and all
(select all). Also, since "Select All" is a possibility, I'm assuming your customSelect
tag renders each option as a checkbox. An example of how mustSelect
might be used:
Mandatory (at least one)
<my:customSelect mustSelect="one">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</my:customSelect>
Optional (zero or more)
<my:customSelect mustSelect="any">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</my:customSelect>
Select all
<my:customSelect mustSelect="all">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
</my:customSelect>
That's an interesting question. I must have come across this situation many times before, but never really thought about it in that way.
Your problem is that your programming language supports two-way options (e.g. zero-or-one) much better than three-way options (zero-one-or-many). The shorthand that arises "naturally" is generally the shorthand that arises from the programming language, so there is no "natural" shorthand for three-way options.
In the spirit of KISS*, I suggest that you append "ZeroOneOrMany" to the property name.
[*] Keep It Simple, Stupid!