The exff Logo

Welcome to the exff Pages

NEWS ABOUT SOFTWARE FAQ GUIDES PAPERS LINKS

UML to EXPRESS Mapping

Resources

SourceForge.net Logo

This document specifies the mapping from UML to EXPRESS that the exff infrastructure implements. The purpose of exff Release 0.1 is simply to show feasibility. This has the implication that UML models that do not strictly follow the Release 0.1 guidelines will not map properly and no checking or error messages will be generated. This also has the implication that care is not taken to support the round trip mapping from UML to EXPRESS and back to UML. Future releases of exff will provide that capability.

A template model is supplied for each tested UML tool as part of Release 0.1. exff may not function properly if these templates are not used.

Whether a UML ModelElement appears on a UML Diagram has no bearing on whether it is considered in the UML to EXPRESS mapping. Any UML ModelElement type not discussed in this document is not considered in the mapping.

UML Package mappings

The first UML Package defined in the UML Model will be mapped to the EXPRESS schema. The name of the UML Package becomes the EXPRESS schema name. All UML Classes and UML Associations within the UML Model are assumed to be considered as part of the mapping into that UML Package.

UML Class mappings

All UML Classes that appear within the UML Model are considered in the mapping (whether they are within the namespace of the first UML Package or not).

Each UML Class is mapped to an EXPRESS entity data type. The name of the UML Class is the name of the EXPRESS entity data type.

Any UML Class with the same name as an EXPRESS simple data type (string, real, logical, integer, Boolean and binary) are not mapped to EXPRESS entity data types regardless of the case of the name. References to any of these UML Classes are assumed to be references to the EXPRESS simple data type during the mapping.

Any UML Generalization relationships between UML Classes are mapped to EXPRESS subtype declarations.

If the UML Class isAbstract attribute is set to 'true', then an EXPRESS ABSTRACT SUPERTYPE constraint is applied to the EXPRESS entity data type mapped from the UML Class.

UML Attribute mappings

Each UML Attribute defined for a UML Class is mapped to an EXPRESS explicit attribute in the EXPRESS entity data type mapped from the UML Class. The name of the UML Attribute is set to be the name of the EXPRESS explicit attribute.

The only UML Attributes that map properly are those with a domain that maps to an EXPRESS simple data type. The EXPRESS data type may be mapped from either a UML Class or a UML Datatype named the same as any of the EXPRESS simple data types.

If the lower bound of the UML Multiplicity is set to zero, then the EXPRESS explicit attribute is set to be optional.

UML Attributes of any Multiplicity other than 1..1 or 0..1 or of any type not mapped to an EXPRESS simple data type are not within the scope of Release 0.1 and therefore are likely not to map properly.

The only additional capability in Release 0.1 is that references to the UML Datatype 'int' are mapped to the EXPRESS integer data type.

UML Association mappings

Some UML Associations are mapped to EXPRESS explicit attributes. Only named UML Associations are considered in the mapping.

Unlike UML Associations between UML Classes, which do not necessarily have a source and target, relationships between EXPRESS entity data types do have a source and target. These relationships are defined as explicit attributes in the source EXPRESS entity data type. The reverse of the relationship may be defined as an EXPRESS inverse attribute but this capability is not included in Release 0.1.

Named UML Associations are mapped properly in two cases:

  1. when the UML Association name and the UML AssociationEnd name related to the target UML Class are the same;
  2. when the UML Multiplicity lower bound is zero on one UML AssociationEnd and is one or more on the other UML AssociationEnd.

Associations mapped by names

When the UML Association name and the UML AssociationEnd name related to the target UML Class are the same, the UML Association is mapped to an EXPRESS explicit attribute in the EXPRESS entity type mapped from the source UML Class. The name of the UML Association is set to be the name of the EXPRESS explicit attribute.

If the UML Multiplicity of the source UML Class is 0..1 and the target UML Class lower bound is 1, then the UML Association is mapped to an optional, single-entity-valued EXPRESS explicit attribute.

Associations mapped by multiplicity

For UML Associations where one AssociationEnd is not named the same as the Association, the EXPRESS entity data type within which the explicit attribute is declared is determined using the UML Multiplicity of the two AssociationEnds. The mapping occurs properly only in the following cases:

  • when the UML multiplicity lower bound is 0 one end and UML Multiplicity 1..1 on the other end, the EXPRESS explicit attribte is created in the entity data type mapped from the UML Class on the end with multiplicity lower bound 0;
  • when the UML multiplicity lower bound is 0 one end and UML Multiplicity 1..n or 1..* on the other end, the EXPRESS explicit attribte is created in the entity data type mapped from the UML Class on the end with multiplicity lower bound 0 and is declared to be a SET[1:n] OF x or SET[1:?] OF x where x is the EXPRESS entity data type mapped from the UML Class at the other end of the Association.

The mapping in all other cases are unpredictable. The result may be as intended but depends on the order within which the UML AssociationEnds appear in the XMI file.

It is best to use the approach of naming one of the UML AssociationEnds to be the same as the UML Association itself.