ChiMu  Publications  Java Development Standards Previous TOC Next 

Objects and Classes

The most obvious difference between UML and my notation is I use hexagons instead of rectangles to identify objects and classes. This is to maintain the property from Booch notation of objects being distinctly recognizable and visible in diagrams. UML/OMT rectangles are neither distinct (other notations use rectangles to indicate tables, rows, layers, etc.) nor particularly visible in complex diagrams. These properties are very important for me.

Undisplayed Graphic

Rumbaugh did have a legitimate argument that Booch clouds were difficult to draw and even to electronically use (because they are hard to connect to). Booch and Rumbaugh came up with a very good (synergistic) solution of using hexagons in early versions of the UML, but later versions of the UML abandoned them. This was unfortunate and I decided not to make the same mistake.

Class Names

The examples do not have the Java standard suffix of "Class" for classes. This is because it is unneeded: classes and types have distinct symbols, so do not share the same name space. When converting design class names to Java names, all classes will have the "Class" or "AbsClass" suffix added to them, and variables will be typed to Java interfaces (for the Type) instead of classes.

Methods

The "compartment" for methods extends beyond the edge of the hexagon because methods are potentially publicly visible. Methods can either all be in one compartment, or separated into different compartments for the different interfaces to the class.

If placed within one compartment, different protocols (groups of methods) are organized like lists are in UML.

I use UML method annotations.

Undisplayed Graphic

Attributes

An attribute is a public property of an object that shows the state of the object. I do not make any distinction between attributes and other methods other than possibly showing them as a separate protocol from other methods. If attributes are independently changable, they will have a corresponding ‘set’ method.

Undisplayed Graphic

Undisplayed Graphic

Frequently there is a minimal collection of attributes that uniquely determine the state of the object, but this should not be confused with the instance variables which may be used to store that state.

Instance Variables

Instance variables are private to a class and a shown in a compartment completely within the hexagon and (usually) below the methods. This is inverted from UML where frequently instance variables are considered attributes and are shown before the methods. Stylistically they are centered and italicized.

Undisplayed Graphic

Message Sends

Inter-class interfaces and message sends can be shown by connecting arrows to the appropriate method of a class.

Undisplayed Graphic

Shorthand for hand drawings

It is acceptable to fall back on just using a rectangle with three compartments (but having instance variables at the bottom) when drawing classes by hand.

ChiMu  Publications  Java Development Standards

 Previous TOC Next 
    Copyright (c) 1997, Mark L. Fussell.

mirror of page http://www.chimu.com/publications/javaStandards/part0009.html