2.7 Comments


In any model, comments are necessary to facilitate human understanding. This holds for a UML/OCL model too. It is good practice to accompany every OCL expression with a comment. A line comment is indicated by two minus signs: --. After this marker, everything on the same line is considered to be comment. Comments that span more than one line can be enclosed between /* and */.

For example, the previous invariant could have been accompanied by the following comments:

 /* the following invariant states that the maximum number of points    that may be earned by all services of a program partner is equal    to 10,000 */  context  ProgramPartner  inv  totalPointsEarning:       deliveredServices.transactions       -- all transactions         ->select( oclIsTypeOf( Earning ) ) -- select earning ones               .points->sum()               -- sum all points                    < 10,000                -- sum smaller than 10,000 


Object Constraint Language, The. Getting Your Models Ready for MDA
The Object Constraint Language: Getting Your Models Ready for MDA (2nd Edition)
ISBN: 0321179366
EAN: 2147483647
Year: 2003
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net