UML Composition

62
rate or flag this page

By umlnotes

Composition 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;

};

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

No comments yet.

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working