Composition

StarUML

Composition

Top  Previous  Next

Semantics

A composite is a more specific type of association. The composite is signified by a filled diamond on the point where the association connects with the classifier (association end). Composite adds the concept of whole and part to the "vanilla" association and responsibility for the lifetime of the parts. The classifier at the filled diamond end is the whole.

Procedure for creating composition

In order to create composition,

1.Click [Toolbox] -> [Class] -> [Composition] button.

ch05_2301

2.Drag from one class and drop to another class composed in the [main window].

ch05_2302

3.Between two classes, a new composition relationship is created as follows.

ch05_2303

Procedure for creating composing class by shortcut creation syntax

In order to create class composing selected class, use shortcut creation syntax.

1.Double-click to popup quick dialog. At the quick dialog, enter name of class composing selected class after "<*>-" string  and separate names with ",".

ch05_2304

2.Press [Enter] key and classes composing selected class are created and arranged automatically.

ch05_2305