UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Stereotyped Constraints in UML

  • Key: UMLR-188
  • Legacy Issue Number: 14544
  • Status: open  
  • Source: Alion Science and Technology ( Mr. James L. Logan III)
  • Summary:

    The UML 2.2 spec (ptc/2008-05-05) does not allow showing only a constraint name in braces. I have found this non-standard feature very valuable when working with business users and would like to see it allowed.

    The most flexible way to use constraints is to have a short, informal English description as the name, and real OCL as the formal expression. Having the flexibility to show either the name or the expression gives the best of two worlds: business SMEs can read and validate the informal English name while tools can use the OCL expression to actually enforce the constraints. In addition, a diagram can present a view for business SMEs or a view for technical people.

    I recommend changing the notation from this:

    <constraint> ::= '

    {' [ <name> ':' ] <Boolean-expression> '}

    '

    to this:

    <constraint> ::= '

    {' [ <name> ] ':' <Boolean-expression> | <name> '}

    '

    This change would allow:

    the author to choose to show:
    only { : expression } for technical users (a common practice)
    only

    { name }

    for non-technical users (a currently disallowed but important practice)
    both

    { name : body }


    the viewer to tell the difference between the name and the expression when only one is shown
    consistency with the way several other things work in UML, such as:
    action names
    action pin names
    instance specification names (i.e., just shows the name when there's no type)

    attributes (i.e., one can suppress the ": Type")

  • Reported: UML 2.5 — Thu, 8 Oct 2009 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT