Skip to content

3.3 Class diagram

The class diagram of the Circle and Point classes and their relationship now looks like this:

Circle with Point centre reference, radius, colour, geometry operations and static Definition Circle with Point centre reference, radius, colour, geometry operations and static Definition

+ means public
- means private
<<constant>> means constant field (PascalCase per C# conventions)
Underlined means static

Each Circle references one Center (Point); a Point may be shared by several circles (see 3.4 The relationship between Circle and Point).

This is design 2. Why the UML is an association (not composition), and how it differs from storing centerX/centerY, is explained in Three ways to give a Circle a centre.