UML Composition
62Composition relationships are a strong form of containment or aggregation (whole/part relationship). However, composition is more than just aggregation. Composition also indicates that the lifetime of the Part is dependent upon the Whole.
For example, Circle is the whole, and Point is part of Circle. If Circle is destroyed, Point will be destroyed with it.
C++ Implementation
class Circle
{
public:
void SetCenter(const Point&);
void SetRadius(double);
double Area() const;
double Circumference() const;
private:
double itsRadius;
Point itsCenter;
};
PrintShare it! — Rate it: up down flag this hub








