Constraints in UML diagrams - UML

Constraints may be used on most UML diagrams, but are especially common on class diagrams. A UML constraintis a restriction or condition on a UML element. It is visualized in, text between braces; for example: { size>= 0 }. The text may be natural language or anything else, such as UML's formal specification language, the Object Constraint Language(OCL) [WK99].

Constraints

Constraints

Qualified Association

A qualified associationhas a qualifierthat is used to select an object (or objects) from a larger set of related objects, based upon the qualifier key. Informally, in a software perspective, it suggests looking things up by a key, such as objects in a HashMap. For example, if a ProductCatalogcontains many Product - Descriptions, and each one can be selected by an itemID, then the UML notation in Figure can be used to depict this.

There's one subtle point about qualified associations: the change in multiplicity. For example, as contrasted in Figure qualification reduces the multiplicity at the target end of the association, usually down from many to one, because it implies the selection of usually one instance from a larger set.

Qualified associations in the UML

Qualified associations in the UML


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

UML Topics