The document discusses various concepts related to modeling associations and links in UML diagrams. It defines different types of associations (binary, n-ary), association classes, association ends (roles, navigation, multiplicity, aggregation, composition, qualifiers), and links (binary, n-ary, link objects). It also discusses types of classes (types, implementation classes, interfaces), packages for organizing model elements, and subsystems for decomposing large systems.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
31 views
System Development Day 2
The document discusses various concepts related to modeling associations and links in UML diagrams. It defines different types of associations (binary, n-ary), association classes, association ends (roles, navigation, multiplicity, aggregation, composition, qualifiers), and links (binary, n-ary, link objects). It also discusses types of classes (types, implementation classes, interfaces), packages for organizing model elements, and subsystems for decomposing large systems.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33
Associations and Links
• An association defines a type of link and is a general
relationship between classes. • For example, the project management system involves various general relationships, including manage, lead, execute, input, and output between projects, managers, teams, work products, requirements, and systems. Binary Associations • A binary association relates two classes.
• For example, one binary relationship in the project
management system is between individual workers and their units of work, and another binary relationship is between individual workers and their work products. Binary Associations • The associations in the figure are as follows: • A worker is responsible for work products and performs units of work • Units of work consume work products as input and produce work products as output.
• Notice that a binary association should be named using a
verb phrase N-ary associations • An n-ary association relates three or more classes. • For example, in the project management system, the use of a worker involves the worker, her units of work, and her associated work products. Association classes • Association classes may be applied to both binary and n- ary associations. Similar to how a class defines the characteristics of its objects, including their structural features and behavioral features, an association class may be used to define the characteristics of its links, including their structural features and behavioral features. These types of classes are used when you need to maintain information about the relationship itself. Binary Association classes • The association classes track the following information: • The reason a worker is responsible for a work product • The reason a worker performs a unit of work • A description of how a unit of work consumes a work product • A description of how a unit of work produces a work product. N-ary Association classes Association ends • An association end is an endpoint of the line drawn for an association, and it connects the association to a class. An association end may include any of the following items to express more detail about how the class relates to the other class or classes in the association: • Rolename • Navigation arrow • Multiplicity specification • Aggregation or composition symbol • Qualifier Assocation ends Rolename • A rolename is optional and indicates the role a class plays relative to the other classes in an association, how the other classes "see" the class or what "face" the class projects to the other classes in the relationship. A rolename is shown near the end of an association attached to a class. Navigation • Navigation is optional and indicates whether a class may be referenced from the other classes in an association. • Navigation is shown as an arrow attached to an association end pointing toward the class in question. If no arrows are present, associations are assumed to be navigable in all directions, and all classes involved in the association may reference one another Multiplicity • Multiplicity (which is optional) indicates how many objects of a class may relate to the other classes in an association. Multiplicity is shown as a comma-separated sequence of the following: • Integer intervals • Literal integer values • Intervals are shown as a lower-bound .. upper-bound string in which a single asterisk indicates an unlimited range. • No asterisks indicate a closed range. For example, 1 means one, 1..5 means one to five, 1, 4 means one or four, 0..* and * mean zero or more (or many), and 0..1 and 0, 1 mean zero or one. There is no default multiplicity for association ends. Multiplicity is simply undefined, unless you specify it. Aggregation • Aggregation is whole-part relationship between an aggregate, the whole, and its parts. This relationship is often known as a has-a relationship, because the whole has its parts.
• Aggregation is shown using a hollow diamond attached to
the class that represents the whole. Aggregation Composition • Composition, also known as composite aggregation, is a whole-part relationship between a composite (the whole) and its parts, in which the parts must belong only to one whole and the whole is responsible for creating and destroying its parts when it is created or destroyed. • It is a ‘contains a’ relationship Qualifiers • A qualifier is an attribute of an association class that reduces the multiplicity across an association. • Essentially, a qualifier is a piece of information used as an index to find the objects on the other end of an association Qualifiers Links • A link is a specific relationship between objects. For example, the project management system involves various specific relationships, including specific manage, lead, execute, input, output, and other relationships between specific projects, managers, teams, work products, requirements, systems, and so forth.
• A link is an instance of an association, and the UML
supports different types of links that correspond to the different types of associations Links • The general rules for representing links in a UML diagram are as follows: • Label links with their association names, and underline the names to show that they are specific instances of their respective associations. • Ensure that link ends are consistent with their corresponding association ends. • Translate association multiplicity into one or more specific links between specific objects. Binary Links • A binary link, which is a specific relationship between two objects, is shown as a solid-line path connecting the two objects in a UML object diagram. N-ary links • An n-ary link, a relationship between three or more objects, is shown as a large diamond with solid-line paths from the diamond to each object in a UML object diagram. Links objects • A link object is a specific instance of an association class, and thus has all the characteristics, including structural and behavioral features, defined by the association class.
• Read the pages about Links.
Types, Implementation classes and interfaces • The kinds of classes discussed thus far are known as undifferentiated classes, and are commonly used during design activities within a development process. • You can also differentiate between three different kinds of classes, called differentiated classes. • These include: • Types • Implementation classes • Interfaces Types • A type is a class that may have attributes, associations, and operations, but does not have any methods. • A type defines a role an object may play relative to other objects, similar to how a rolename indicates the role a class plays relative to other classes in an association. Implementation classes • An implementation class is a class that may have attributes, associations, operations, and methods. An implementation class defines the physical implementation of objects of a class. Interfaces • An interface is a class that may have operations but may not have attributes, associations, or methods. • An interface defines a service or contract as a collection of public operations. Packages and subsystems • As a model may have hundreds (if not thousands) of model elements, how do you organize the elements that make up a system and their relationships? Packages • A package is a grouping and organizing element in which other elements reside, which must be uniquely named. In the UML, packages are used in a manner similar to the way directories and folders in an operating system group and organize files. Packages Subsystems • Recall that a system is an organized collection of elements that may be recursively decomposed into smaller subsystems and eventually into nondecomposable primitive elements.
• The project management system may be decomposed
into the following: • A user interface subsystem responsible for providing a user interface through which users may interact with the system • A business processing subsystem responsible for implementing business functionality • A data subsystem responsible for implementing data storage functionality Subsystems