previous | start | next

Design: Class Relationships - local or parameter class declarations

The Point class has a member function toString()

        
        string Point::toString() 
        {
          string result;
          ....

          return string;
        }
     

This function returns a string such as "(3,4)" representation of the Point value with member x value 3 and member y value 4.

So the Point class uses the string class, but the Point class does not have a string data member.

The relationship between Point and string is not aggregation. It is a weaker relationship, but the Point class does depend on the string class.

This dependency relationship will simply be referred to as "depends-on" or "uses".



previous | start | next