uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

2D Shapes System

Example

// 2D Shapes class hierarchy - sample UML class diagram in Umple
// From Book by Lethbridge and Laganiere, McGraw Hill 2004
// Object-Oriented Software Engineering: Practical Software Engineering using UML and Java
// See http://www.lloseng.com

//Namespace for core of the system.
namespace Shapes.core;

class Shape2D {
 center;
}
//Abstract
class EllipticalShape {
 isA Shape2D;
 semiMajorAxis;
}
//Abstract
class Polygon { 
 isA Shape2D;
}
class Circle {
 isA EllipticalShape;
}
class Ellipse{
 isA EllipticalShape;
}
class SimplePolygon {
 orientation;
 isA Polygon;
}
class ArbitraryPolygon {
 points;
 isA Polygon;
}
class Rectangle {
 isA SimplePolygon;
 height;
 width;
}
class RegularPolygon {
 numPoints;
 radius;
 isA SimplePolygon;
}

      

Load the above code into UmpleOnline