Attribute

Home > Metamodelling Concepts > Attribute

An attribute is an unidirectional relation between entity and attribute classes or between attribute classes among each other. Attributes model part-of relations. With the help of attributes you are able to specify what kind of information an entity can or has to carry.

In relational terms an attribute is nothing else than a table column. But be aware - you are not bound to atomic values in table columns, rather it is possible to couple hierarchical trees of attribute objects to an entity in the context of one sole attribute relation.

Moreover you can design exact multiplicities with lower and upper limits for your attributes which are guaranteed by the data container at transaction commit. For example a multiplicity of "1..*" conforms a "not null" constraint.

If the upper limit of a multiplicity is greater than one, the marker Set specifies that an attribute relation might not contain duplicates. The marker Vector means that the order of contained attribute objects is preserved by the container.

In SDL attributes are represented by Java class members. There are some special annotations as well.

  • @attribute - attribute with the multiplicity 0..1 or 0..*
  • @attribute @notnull - attribute with the multiplicity 1..1 or 1..*
  • @attribute (mult = 2..3) - attribute with the multiplicity 2..3

Here are a few examples:

@attribute String name;
@attribute @notnull Boolean clever;
@attribute @notnull Set<String> friends;
@attribute (mult = 2..3) Vector<String> enemies;

Next chapter: Association and Composition

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.