Skip to content

4.5 Class diagram

Inheritance is shown with <|-- (same role as a white triangle in UML: derived class). The complete class diagram looks like this:

Mermaid diagram Mermaid diagram

+ means public
- means private
# means protected
<<constant>> means constant field (PascalCase per C# conventions)
Underlined means static
Open arrow means unidirectional (association to Point)
CalculateArea() and CalculatePerimeter() on Shape are virtual; in Circle and Rectangle they are overridden.
DescribeSize() exists only on Shape and is used by derived instances.
Multiplicity *1 on an association: many Circle or Rectangle instances may reference the same Point; each instance still has exactly one Center / TopLeftCorner.