Free e-Books

open all | close all

Quote of the Day

“Giving up doesn’t always mean you are weak … sometimes it means that you are strong enough to let go”

Composite Structure Diagram

Print This Page Print This Page

The composite structure diagram allows the modeler to describe the relationships between elements that work together within a classifier. It is similar to the class diagram, but shows parts and connectors. The parts are not necessarily classes in the model and they do not represent particular instances, but they may be roles that classifiers may play.

Architectural Concepts in UML 2

Perhaps the most important improvement in UML2.0 with respect to modeling complex systems is the increased architectural support. Entities often cooperate with each other to produce the behavior of a system. Structured classifiers are Classes, Collaborations, and Components. Therefore a class may describe its behavior as a collaboration of behavior of instances of other classes contained in the class.

The core constructs of structured classifiers for architectural modeling include Part, Connector, and Port. Structured classifiers support the description of the structure and the relationships of the participants that jointly perform a task of the system, and the ability to encapsulate/isolate this internal structure to achieve plug-substitutability for a system.

Parts

Part represents a set of instances that are strongly aggregated within a containing classifier instance. Parts may be joined by attached connectors and specify configurations of linked instances.

Car CLASS Pari in: COMPONENT LENT CONNECTOR

Connectors

Specifies a link (an instance of an association) that enables communication between parts in a structure and with the

Car Porl SHAFT Engine

Ports

Port: Specifies an addressable interaction point between a classifier and its environment. Describes the services a classifier offers to its environment at this point, and the services the classifier expects from the environment.

POWER ENGINE

Figure 3 Ports connected to classes

* Encapsulate communication with a classifier

* Provided interface specifies services offered by the classifier to its environment

* Required interface describes services the classifier expects from its environment

* Enables specification of a classifier without knowing anything about the environment in which the classifier will be used.

Composite Structure Diagram Examples

A class diagram can be contained the package Cars, with a class symbol representing the fact that the Cars package contains a class Car. ii) is a composite structure diagram for this class Car.

PACKAGE AXLE CARS CAR

i) Class symbol for class in the Cars Package

AXLE

ii) Composite Structure Diagram for the Class Car

The Composite Structure Diagram is also useful in displaying collaborations of classes as they, for example will realize a use case. The notations used can be as follows:

Example: Collaboration with classes inside

Observe r

Example: Collaboration connected to classes

An example of how threading Observere collaboration may be used:

MER Cleifc

For the use case: Capture customer, the Clerk will capture the customer, the customer address and the related customer account. The composite structure diagram for this collaboration may look like this:

ACCOUNT

To explicitly show the realization, the following diagram may be used:

REAL COMPOSITE Capture ijreC ADDRESS CLERK