• No se han encontrado resultados

NACIONALES DE LA MEZCLA PARA CONSUMO NACIONAL

En su primer período de vigencia (junio 8/76 -Febrero 27/79), los TAC podían aplicarse a los usos

NACIONALES DE LA MEZCLA PARA CONSUMO NACIONAL

In this Section, we present the main changes in class diagrams resulting from the new definition of association and new mechanisms related to generalizations.

2.1. Association

An association is a specification of a semantic relationship among two or more classes. An association in UML 2.0 is defined slightly different as in UML 1.x. Firstly, an association in UML 2.0 is a classifier. An instance of an association is called a link. A link is a tuple with one value for each end of the association. The value for each association end contains a reference to an object of the associated class. It contrasts to UML 1.x, where the link is a tuple of objects of associated classes. Secondly, semantics of an association in UML 2.0 is considered as a description of a collection of links. The collection of links may be a set, a bag or a list. Such a collection is called an extend of the association.

An association has an optional name, but most of its description is found in a list of its association ends, each of which describes the participation of objects of connected class in the association. Each association end specifies properties that apply to the participation of the corresponding objects, such as multiplicity, and other properties like navigability or aggregation that apply to binary associations only, but most properties apply to both binary and n-ary associations (n > 2).

The meaning of multiplicity is described as follows. For n-ary association, choose any n – 1 ends and associate specific instances with those ends. Then the collection of links of the association that refer to these specific instances will identify a collection of instances at the other end. The multiplicity of the association end constrains the size of this collection [15]. If the association end is declared as unique, this collection is a set; otherwise this collection is a bag. If the association end is declared as ordered, this collection will be ordered.

The information about uniqueness and ordering of an association end will be represented by strings enclosed in curly braces near this end. The decoration {ordered} shows that the end represents an ordered collection, and {bag} shows that the end represents a bag, i.e. a collection that permits the same element to appear more than once. Figure 2.a illustrates an exemplary class diagram, where association AssOL describes a collection of links being a bag, and Figure 2.b presents an object diagram — an instance of the class diagram.

N-ary associations are further not considered.

Figure 2. a) The class diagram, b) The object diagram

2.2. Generalization Set

Generalization in UML 2.0 is defined in similar way as in UML 1.x, i.e. as a taxonomic relationship between a more general and more specific element. The only difference is that generalizations may be defined between associations as the associations in UML 2.0 belong to classifiers.

A more general class (superclass) may be specialized into more specific classes (subclasses) along a given dimension, representing selected aspects of its structure or semantics. For example, taking sex into account a superclass Person may be specia- lized into two subclasses Male and Female representing persons of different sex (Figure 3). A set of generalizations representing such a dimension is called a generali- zation set. UML 2.0 generalization sets replace UML 1.x discriminators with roughly equivalent capability. The generalization set may have properties that are expressed in terms of the following standard constraints:

{disjoint} meaning that any object of a superclass may be an instance of at

most one subclass;

{overlapping} meaning that any object of a superclass may be an instance of more then two subclasses;

{complete} meaning that every object of a superclass must be an instance of at

least one subclass;

{incomplete} meaning that an object of a superclass may fail to be an instance of any subclass.

The constrains may be used individually or may be arranged in pairs: {disjoint, complete}, {disjoint, incomplete}, {overlapping, complete}, and {overlapping, incom- plete}. The default constraint is {disjoint, incomplete}.

A given superclass may posses many generalization sets representing multiple dimensions of specialization. Each generalization set has its name shown as a text label following a colon on generalization arrow.

The example in Figure 3 exhibits two generalization sets Sex, and Status. 2.3. Power Types

Powertype is a new mechanism introduced by UML 2.0. It is a metaclass related to a given generalization set. Instances of the metaclass are subclasses of the same

superclass associated to a given power type class. For example, instances of the generalization set Status in Figure 3 are Student, Teacher, and Employee. The figure also exhibits the metaclass Status (labeled with «powertype») related to the generali- zation set with the same name. Multiplicity of the association end at Status metaclass is a consequence of constrains {incomplete, disjoint} imposed on the Status generali- zation set. It says that each object of the Person class may belong to at most one subclass.

Figure 3. Generalization set and powertype example

The powertype adds the ability to declare properties that apply to individual subclasses in the generalization set. It means that the property assigned to a given subclass is a common property for all instances of the subclass. For example, the powertype Sex introduces two attributes: model weight, and model height. These attributes have some values, which are the same for all instances of the subclass Female, and other values, which are the same for all instances of the subclass Male.

Documento similar