

UMLSpeed Reference

Robin Rawson-Tetley

1 Editing Code

Code can be edited with any standard text editor. 
Included is a syntax highlighting file for vim (my 
editor of choice).

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_vim.png>


2 Class Diagram Entities

2.1 Namespace

namespace name[.name][...];

The namespace declaration switches the current 
namespace to the name given. All entities declared 
after this point will take on this namespace.

Dot characters can be used to separate components of 
the namespace, but the namespace should contain no 
special characters or spaces.

Namespaces are used primarily during XMI output and 
code generation and map to packages or files depending 
on the code language.

2.2 Class

class [(baseclass1, baseclass2 ...)]{

    comment = "comment text"; 

    [modifiers = (modifier1, ...);]

    fields {

        [+#-]field: type;

        ...

    }

    operations {

        [+#-]operation(arg: type, ...): returntype;

        ...

    }

}

Declares a class entity. It is important that the 
return type is set to "void" for no return type.

fields{} holds the list of member fields/attributes for 
the class and operations{} holds the list of 
operations/methods for the class.

Both fields and operation names should be preceded by 
an access modifier. + = public, - = private, # = protected/friend

2.2.1 Class Modifiers

* public

* private

* friend

* abstract

2.3 Interface

interface [(superinterface1, superinterface2 ...)]{

    comment = "comment text";

    operations {

        [+#-]operation(arg: type, ...): returntype;

        ...

    }

}

Declares an interface entity. Interfaces are almost 
identical to classes, except they can only inherit from 
other interfaces, are automatically abstract and cannot 
have fields.

2.4 ClassDiagram

classdiagram name {

    comment = "legend";

    documentation = "Some documentation.<br/> in HTML format";

    layout = satellite (entity) | grid (cols, entity ...);



    entities {

        entity1 [relationship entity2];

        ...

    }

    [visuals {

         entity_margin = <integer>;

    }]

}

Declares a class diagram for output as SVG. The comment 
text will be used as a legend for the diagram.

The entities collection should be a list of entities 
with their relationships to other entities. Entities 
only have to appear once in here to be drawn on the 
diagram (it doesn't matter which side of a relationship 
they are on).

The layout determines how the diagram will be laid out.

2.4.1 Satellite Layout

Satellite layout lays the entities out in the order 
that they appear in the entities list around a central 
entity. Entities are split into two horizontal rows at 
the top and bottom of the diagram. The satellite entity 
(named in the argument to the layout) is placed in the 
center of the diagram.

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_class2.png>


<Graphics file: /home/robin/workspace/umlspeed/doc/ums_class2_code.png>




2.4.2 Hierarchy Layout

The hierarchy layout accepts no arguments. 

This layout uses the entity links to try and best order 
the entities in a hierarchy with the entities with the 
most outgoing links at the bottom.

2.4.3 Grid Layout

Grid layout accepts a number of a columns, and then a 
comma separated list of entities. The entities will be 
placed in a grid with the given number of columns, in 
the order that they appear in the list.

If you put the symbol * (asterisk) instead of an entity 
name, that grid cell will be skipped. 

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_class1.png>


<Graphics file: /home/robin/workspace/umlspeed/doc/ums_class1_code.png>


You can also declare packages with the GridLayout 
(regardless of the type of diagram). After the layout 
arguments, specify one or more packages in the form:

pkg:Package Name:x:y:width:height

x, y, width and height are all expressed in terms of 
cells in the grid. x and y are zero based with 0,0 
being the top left cell of the grid.

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_classpkg1.png>


<Graphics file: /home/robin/workspace/umlspeed/doc/ums_classpkg1_code.png>


2.4.4 Class Relationships

* Depends

* Extends

* Implements

* OneToOne

* OneToMany

* ManyToMany

* ManyToOne

2.5 SequenceDiagram

sequencediagram name {

    comment = "comment text";

    documentation = "Something in HTML";

    entities {

        entity1 [relationship] entity2 [message];

        ...

    }

    [visuals {

         entity_margin = <integer>;

    }]

}

Declares a sequence diagram for output as SVG. The 
comment text will be used as a legend for the diagram.

The entities collection should be a list of class 
entities with their invocations to other entities. 
Entities only have to appear once in here to be drawn 
on the diagram (it doesn't matter which side of a 
relationship they are on).

2.5.1 Sequence Invocations

These invocations translate to messages drawn between 
the classes on the sequence diagram. If the type is 
Invokes/InvokesAsync, then a string should be given to 
be rendered over the message line. If the string is an 
operation name on the target class, UMLSpeed will look 
up the operation signature and display that.

* Creates

* Invokes

* InvokesAsync

2.5.2 Layout

Sequence diagrams don't have a choice of layouts like 
the other diagrams, as they have a single implicit layout:

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_sequence1.png>
<Graphics file: /home/robin/workspace/umlspeed/doc/ums_sequence1_code.png>


3 Use Case Entities

3.1 Actor

actor actor = "text";

3.2 UseCase

usecase usecase = "text";

3.3 UseCaseDiagram

usecasediagram {

    comment = "comment text";

    layout = satellite (entity) | usecase | grid (col, 
entity ...);

    documentation = "Some HTML";

    entities {

        entity1 [relationship entity2];

        ...

    }

    [visuals {

         entity_margin = <integer>;

    }]

}

3.3.1 Satellite and Grid Layout

See Satellite and Grid Layout for class diagrams.

3.3.2 Use Case Layout

Use Case layout arranges the entities into a hierarchy 
based on the number of links. It is the same as the 
hierarchy layout, but spreading out from the left-hand 
side instead of the bottom.

<Graphics file: /home/robin/workspace/umlspeed/doc/ums_usecase1.png>


<Graphics file: /home/robin/workspace/umlspeed/doc/ums_usecases1_code.png>




3.3.3 Use Case Relationships

* Uses

* Includes

* Extends
