Asset Oriented Modeling (AOM)

- Type -

Types can be simple, complex or undefined:

  • Simple types are for atomic properties. We do not propose an own type system but rely on existing type systems, e.g. Java types, SQL types, XML Schema built-in types. The default type system is defined in the global model definition. If another type system is used locally, we prefix it with the type system prefix which is defined in the global model definition, too. The prefix is separated from the type name with an underscore, e.g. sql_TIME.

    In case of multi-token type names, the type is enclosed in parentheses, e.g. (BIT VARYING) bitProp.
  • Type expressions for simple types:

    Syntax Description Examples
    type
    Simple type
    float

    Property contains a floating point value

    (type1|type2)
    Type union
    (float|int)

    Property contains a floating point or integer value

    (type1,type2)
    Type sequence

    Note: Type sequences must not directly or indirectly contain a complex type.

    (NMTOKEN|int)

    Property contains a name token followed by an integer value

    {value1,value2,...}
    Type restriction by enumeration. Only the listed values are allowed for the property.

    Note: Enumeration values that contain syntactical characters are enclosed in single or double quotes.

    int{1,2,3}

    Property contains one of the listed integers.

    {I,II,III}

    Property contains one of the listed values of undefined type.

    type(param1=value1,
    param2=value2,
    ...,
    @att1=attVal1,
    ...)
    type(param1,param2,
    ...,
    @att1=attVal1,
    ...)
    Type parameters and attributes. Type parameters depend on the type system used (e.g. restricting facets in XML Schema or length specification in SQL)

    Type attributes are identified by names starting with the 'at'-character(@). They must specify a single string value. Type attributes should be written at the very end of a type parameter expression. Type attribute names must be unique within the scope of a typed property.

    Note: Parameter values that contain syntactical characters are enclosed in single or double quotes.

    decimal(fractionDigits=2)

    Property contains decimal values with two fractional digits.

    varchar(25)

    Property contains up to 25 characters.

    float(@unit=inch)
    type
    type@asset
    Unqualified type reference. Refers to a type declaration.

    Qualified type reference. Must be used when the unqualified type reference is not unique. Should be used when the type reference is not local (within the same asset).

    numeric
    numeric@businessTypes
     

    Types, type sequences, and type unions can be postfixed with a modifier.

    Syntax Description Example
    ?
    Optional type (used in sequences)
    (NMTOKEN?,int)

    Property contains an integer which can optionally be prefixed with a name token.

    +
    List extension of type with at least one occurrence
    (NMTOKEN,int+)

    Property contains a name token which is followed by at least one integer.

    *
    Optional list extension of type
    (NMTOKEN,int*)

    Property contains a name token which may be followed by integers.

    [n..m]
    List extension of type with at least n occurrence and at most m occurrences
    (NMTOKEN,int[2:4])

    Property contains a name token followed by 2-4 integers.

    Modifiers must be used in such a way that the resulting type expressing disallows the empty string. For example, float? or (NMTOKEN | float?) is invalid while (NMTOKEN, float?) is valid.

  • Complex types can be used to define complex properties. Complex types are defined  as assets. Consequently, each asset can be used as a type. A complex type expression specifies an asset defined elsewhere in the model by name (never by display label). 
  • Type expressions for complex types:

    Syntax Description Examples
    type
    Complex type
    person

    Property contains a structure as defined in asset person

    (type1|type2)
    Type union
    (person|company)

    Property contains either a structure as defined in asset person or a structure as defined in asset company

    Note: Complex types cannot be used in type sequences.
  • A property without a type definition has an undefined type.
  • Type declarations can be used to assign a name to a type expression. The expression can be any valid type expression. Recursive definitions are not allowed.
  • Syntax Examples
    !name expression
    !numeric (float|int)

    !dec2 decimal(fractionDigits=2)

     

    Example for simple type usage

    Example for complex type usage


    Equivalent definitions:

    The type syntax for complex types is only an abbreviation for inheritance relation. Please note that this equivalence holds only if the type asset and its superassets do not connect to other assets via arcs except inheritance arcs.

    Type syntax

    Equivalent syntax

    Type syntax for union type

    Equivalent syntax

     
    Home Definition Step-by-Step Examples Downloads

    Contact: support 'at' aoModeling.org