Notice that, for any multi-valued enumeration attribute (like
someThings) we add a class-level check function for single
checkSomeThing) and another one for value sets
checkSomeThings), both returning an object of type
The implicit getters and setters implied by the «get/set» stereotype are a special feature
of ES5, allowing to define methods for getting and setting the value of a
property p while keeping the simple
syntax of getting its value with v =
o.p, and setting it with o.p =
expr. They require to define another,
internal, property (like
_p) for storing the value of
p because the name "p" does not refer
to a normal property, but rather to a pair of get/set methods.
The most common reason for using implicit getters and setters is the need to always check constraints before setting a property. This is also the reason why we use them.