This page is a work in progress page, and may be incomplete and/or unreliable. We are currently setting up the basic infrastructure of this site. We try to get as much documentation online as fast as possible. If you feel it takes us too long to get this page fleshed out, let us know, so we can give it priority and help you out. Thanks for your patience.

Contents

Using ADL

Introduction

This reference page describes all aspects of the Abstract Domain Language. Consult it when you need information about a specific ADL element.

Before diving in, you might want to read about ADL's history and concepts.

Diagram

A Diagram is the top level element of UmlCanvas. Like any construct it has a name.

Diagram <name>;

Static / Dynamic

Two modifiers are available for Diagram: static and dynamic. If not specified, a Diagram defaults to static. This causes the elements on the diagram to be static, meaning they cannot be moved by the viewer of the diagram.

Diagram <name> +static;

When specifying dynamic on the other hand, the elements on the diagram will be movable by the viewer of the diagram, enabling him to rearrange them.

Diagram <name> +dynamic;

Class

To add a class to a diagram, define it using the Class element.

Class <name>;

Abstract

To define an abstract class, add the abstract modifier to the class.

Class MyClass +abstract;

Attribute

Most classes have attributes, so let's find out how they are defined.

In its most simple form, an Attribute takes the form:

Attribute <name>;

It is added to the body of a classifier, like a class:

Class MyClass {
  Attribute myAttribute;
}

By default an attribute will be a public instance property. By using modifiers, the visibility and the static property of an attribute can be changed.

Note that UmlCanvas supports aliases for construct names. Property and Atribute are synonyms and can both be used on the same diagram.

Visibility

UmlCanvas supports private, public and protected access modifiers for attributes. We will add package visibility in a subsequent release. Setting the visibility can be done by adding one of these modifiers to an attribute: private, public, protected.

Attribute <name> +private;

Static

To mark an attribute as static, add the static modifier to it.

Attribute <name> +static;

Operation

Just like properties, operations can be added to classifiers.

They take the following form:

Operation <name> : <ReturnType>;

Next to specifying the return type - which is optional - an operation can have parameters.

A parameter needs to be defined in the body of an operation. Operation parameters take the form:

Parameter <name> : <Type>;

Again, the parameter type doesn't need to be specified, but note that UmlCanvas only displays parameter types for now (if the parameter type is not specified, UmlCanvas will not render the parameters).

Note that you can also use the Argument alias for Parameter.

Visibility

UmlCanvas supports private, public and protected access modifiers for operations. We will add package visibility in a subsequent release. Setting the visibility can be done by adding of these modifiers to a property: private , public, protected.

Operation <name> : <ReturnType> +protected;

Static

To mark an operation as static, add the static modifier to it.

Operation <name> : <ReturnType> +static;

Abstract

To define an operation as abstract, add the abstract modifier to it.

Operation <name> : <ReturnType> +abstract;

Interface

To add an interface to a diagram, define it using the Interface element.

Interface <name>;

UmlCanvas will render it just like class, but it'll add the interface stereotype to it.

To add properties and/or operations to an interface, see Class.

Enumeration

To add an enumeration to a diagram, define it using the Enumeration element.

Enumeration <name>;

UmlCanvas will render it just like class, but it'll add the enumeration stereotype to it.

Enumeration literals can be added as attributes:

Enumeration Color {
  Attribute RED;
  Attribute GREEN;
  Attribute BLUE;
}

Generics

ADL supports generics. An ADL generic can be added to classifier names:

Class MyClass<T>;

Positioning classifiers

The position of classifiers (Class, Interface and Enumeration) can be set by the position annotation '@'. It takes an x- and a y-coordinate, relative to the top-left corner of the diagram.

[@x,y]
Classifier myClassifier;

Relationships

Association

An association between elements takes the form:

Association <name> {
  <RoleOne>;
  <RoleTwo>;
}

Role

A role is part of an association. It takes a name and a type:

Role <name> : <Type>;

Shared

To mark the element of the other role as shared by the element of this role, add the shared modifier to it.

Role <name> : <Type> +shared;

Composite

To mark the element of the other role as a composite element of the element of this role, add the composite modifier to it.

Role <name> : <Type> +composite;

Navigability

To mark the element of a role as navigable by the element of the other role, add the navigable modifier to it.

Role <name> : <Type> +navigable;

Dependency

A dependency from one element to another is described by the Dependency construct, which contains a client element and a supplier element. The client has a dependency on the supplier.

dependency <name> {
  Client <name> : <Type>;
  Supplier <name> : <Type>;
}

Inheritance

An inheritance relation is not explicitly defined in ADL. UmlCanvas will show an inheritance relation for each inheritance notation it encounters.

Classifier myClassifier : SuperType;

Realization

A realization relation is not explicitly defined in ADL. UmlCanvas will show an inheritance relation for each interface realization it encounters.

Classifier myClassifier : Interface;

Positioning relationships

The way relationships are presented can be manipulated by the corner annotation. If this annotation is not set, UmlCanvas will connect both ends of the relation using a straight connector using angles if needed.

The corner annotation takes two sides, x and y. 'x' defines the side to which the connector should be attached on the first related element, 'y' defines the side to which the connector should be attached on the second related element.

[@corner:x-y]
Classifier myClassifier;

Allowed values for 'x' and 'y' are depicted in the following diagram:

Note

A note can be added by declaring a note element:

note <name> +text="A note\non two lines";

To link the note to one or more elements on the diagram, use the linkedTo modifier:

class MyClass;
class MyOtherClass;
note <name> +text="A note\non two lines" +linkedTo=MyClass,MyOtherClass;


For Everyone

For Developers

Social Modeling

News & Updates

Retrieved from "http://umlcanvas.org/Using_ADL"

This page has been accessed 360 times. This page was last modified on 25 February 2010, at 23:02. Content is available under Attribution-Share Alike 3.0 Unported.