UML&OCL Modeling Languages


Practice (5a)

  1. Represent UML classes' diagram concepts by in the way of a class diagram !
    This defines what is called a "meta" model (and the specification of a modeling language - see for instance java reflection).
  2. Express, by using the OCL, the if a class C has singleton stereotype then it must have a single instance.
  3. How to specify that a class D has a attribute v whose value is between 1 and 5 ?
  4. The class D has an attribute ds that is a set of D. How to specify that the size of ds must be inferior to v ?
  5. How to formalize that an instance of D can not be contained in ds ?
  6. By knowing that D as an attribute es that is a set of E, how to define that the size of es must be equal to the size of ds ?
  7. E has two attributes (k,v). How to express that two distinct elements from es having different k must have different v ?