UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Questions about DataTypes and generalization

  • Key: UMLR-22
  • Legacy Issue Number: 7223
  • Status: open  
  • Source: Red Hat ( Randall Hauch)
  • Summary:

    I have a few questions regarding section 7.12 entitled "Kernel - the
    DataTypes Diagram" in the final adopted Superstructure spec (03-08-02).

    DataType specializes Classifier, and as such it also inherits the ability to
    have generalization relationships with other Classifiers. Classifier has an
    additional operation 'maySpecializeType(Classifier):boolean' that is
    described/defined as follows:

    "The query maySpecializeType() determines whether this classifier may have a
    generalization relationship to classifiers of
    the specified type. By default a classifier may specialize classifiers of
    the same or a more general type. It is intended to be
    redefined by classifiers that have different specialization constraints."
    (p. 63)

    with the OCL:

    Classifier::maySpecializeType(c : Classifier) : Boolean;
    maySpecializeType = self.oclIsKindOf(c.oclType)

    DataType, nor its subtypes PrimitiveType and Enumeration, defines no
    additional constraints or additional operations. These additional
    constraints are executed/applied in the UML2 metamodel (rather than in a
    UML2 model), correct? If so, then this implies that a DataType may
    specialize another DataType, Classifier, Namespace, Type, etc., but that
    DataType may not specialize PrimitiveType or Enumeration. Please correct me
    if I'm interpreting this incorrectly.

    Consider an example with:

    • a PrimitiveType named "string"
    • a PrimitiveType named "float"
    • a DataType named "InternationalPrice" that specializes "float" and
      adds a new attribute/property called "currency" of type "string"

    The "InternationalPrice" DataType is conceptually a qualified type, meaning
    it is a float plus a qualifier of the value. Examples of instances would be

    {426.36, "US Dollars"}

    ,

    {401.23, "Euros"}

    ,

    {749.42, "Yen"}

    .

    If my interpretations of the Superstructure spec are correct, then this
    example cannot be modeled using UML2. And, in fact, the specification would
    actually allow me to create a new PrimitiveType named "double" that actually
    specializes my "InternationalPrice" DataType (since DataType is a supertype
    of PrimitiveType). My thought is that this is either a issue with the
    'maySpecializeType' operation or it is an issue with DataType, PrimitiveType
    and Enumeration not being properly constrained.

  • Reported: UML 2.5 — Tue, 6 Apr 2004 04:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT