Jump to content

Composite structure diagram

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gopal Sarda CS (talk | contribs) at 20:08, 20 September 2011 (Composite structure concepts Part). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Composite structure diagram in the Unified Modeling Language (UML) is a type of static structure diagram, that shows the internal structure of a class and the collaborations that this structure makes possible.

This diagram can include internal parts, ports through which the parts interact with each other or through which instances of the class interact with the parts and with the outside world, and connectors between parts or ports. A composite structure is a set of interconnected elements that collaborate at runtime to achieve some purpose. Each element has some defined role in the collaboration.

The composite structure diagram and related notions have been introduced into UML2.0 to supplement already existing artifacts such as classes. However the usage of these constructs by engineers and/or modellers is not always in the spirit of inventors of these constructs. A number of additional interpretations develop which are not always consistent with the intended usage of the structure nor with the language itself. Understanding these additional usages assists in understanding areas of ambiguity, extension, inconsistency and the future development of the language.

As tools become more UML compliant and support more UML constructs, engineers and/or modellers start to use these additional constructs. The effect of this is that the semantics of these constructs is often learnt through an implicit process based around the name of the construct and what the tool appears to allow; the semantics are often based on the engineer’s expectations and perceived meaning rather than on the actual, intended semantics.

It always show us the internal structure of the given system.It depends on the internal parts that are used in the system. It just show us how the interaction of the various parts happens. It is like container which contain interaction points of various parts of the system and showing us the configuration and relationships of those parts.

Composite structure concepts

UML 2.0 composite structure diagram.

The key composite structure entities identified in the UML 2.0 specification are structured classifiers, parts, ports, connectors, and collaborations[1].

  • Part : A part represents a role played at runtime by one instance of a class or by a collection of instances. The part may only name the role, it may name an abstract superclass, or it may name a specific concrete class. The part can include a multiplicity factor, such as the [0..*] shown for Viewer in the diagram.

A part is like small element in the Composite Structure Diagram, which is set of some instances those are under control of the classifier instance. A part can be deleted from its parent node or bigger part before that bigger part ( parent ) deleted, so it is clear that part is not deleted at the same time when parent deletion is going on.

An EncapsulatedClassifier is a type of structured classifier that contains ports. In the diagram above, both FibonacciSystem and Variable are encapsulated classifiers because they both have ports along their boundaries.

Composite structure diagram example

As an example, consider one possible way of modeling production of the Fibonacci sequence.

This UML 2.0 composite structure diagram specifies that instances of the 'FibonacciSystem' class are composed of a number of parts. The topmost of these parts is identified as having the classifier 'FibonacciFunction'. Three of the parts are identified by the role they play within instances of FibonacciSystem - the NMinus2 role, the NMinus1 role, and the N role. The fifth part, identified by its classifier Viewer, includes a multiplicity specification. At runtime there can be 0 or more instances of Viewer or some concrete subclass of Viewer.

At runtime the class instances that implement these three roles must provide the services specified by the IVar interface through their var ports. One such class is Variable, shown on the diagram with a port named var of type Var that realizes the IVar interface.

The port named "view" is a non-public port that can be used by an instance of FibonacciSystem to access the optional instance(s) of Viewer.

References