Show Menu
Cheatography

UML Class DIagram Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Class Members

public
+
private
-
package
~
protected
#
abstract
italics
static
underline
constant
ALL_CAPS

Sample Person Class

public class Person {

    // member variables
    private long  id;
    private String name;
    private Date birthday;

    // constructor
    public Person(long id, String name, 
                  Date birthday) {
        this.id = id;
        this.name = name;
        this.birthday = birthday;
    }

    // rest of the class omitted ...
}

Person UML Diagram

Should follow the following syntax
name : attribute type

therefore:
id : int

Default value
name : attribute type = default value
id : int = 1