UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Optional values and evaluation of defaults

  • Key: UMLR-99
  • Legacy Issue Number: 9887
  • Status: open  
  • Source: Adaptive ( Mr. Pete Rivett)
  • Summary:

    7.3.44 says that the defaultValue is "A ValueSpecification that is evaluated to give a default value for the Property when an object of the owning Classifier is instantiated."
    This makes it a bit pointless to have such as property as optional since it will always be set to its default value (though in theory the property could be explicitly unset - in which case it will not use the default value either.
    There is a need for dynamic evaluation of an expression associated with a Property if no value has been explicitly set.

    Proposed resolution:

    • if lower = 1 then defaultValue is assigned to the property when object is instantiated (and when the class is attached to an object using reclassify)
    • if lower = 0 then no assignment is made but the defaultValue (if present) is evaluated each time the property value is read: in effect it is acting as a derived property until a value is explicitly assigned.

    This behavior must also be included in the description of ReadStructurualFeatureAction (11.3.37) which does not mention default values at all.

  • Reported: UML 2.5 — Thu, 6 Jul 2006 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT