|
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.
A Diagram is the top level element of UmlCanvas. Like any construct it has a name.
Diagram <name>;
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;
To add a class to a diagram, define it using the Class element.
Class <name>;
To define an abstract class, add the abstract modifier to the class.
Class MyClass +abstract;
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.
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;
To mark an attribute as static, add the static modifier to it.
Attribute <name> +static;
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.
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;
To mark an operation as static, add the static modifier to it.
Operation <name> : <ReturnType> +static;
To define an operation as abstract, add the abstract modifier to it.
Operation <name> : <ReturnType> +abstract;
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.
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;
}
ADL supports generics. An ADL generic can be added to classifier names:
Class MyClass<T>;
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;
An association between elements takes the form:
Association <name> {
<RoleOne>;
<RoleTwo>;
}
A role is part of an association. It takes a name and a type:
Role <name> : <Type>;
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;
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;
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;
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>;
}
An inheritance relation is not explicitly defined in ADL. UmlCanvas will show an inheritance relation for each inheritance notation it encounters.
Classifier myClassifier : SuperType;
A realization relation is not explicitly defined in ADL. UmlCanvas will show an inheritance relation for each interface realization it encounters.
Classifier myClassifier : Interface;
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:
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
|