list of dots Digital Research Alliance of Canada logo  NSERC logo  University of Ottawa logo / UniversitĂ© d'Ottawa

User Manual    [Previous]   [Next]   

Use Statements

Use statements allow you to decompose your system by embedding or referencing files containing other model elements (such as classes) into your current model, or to include optional code blocks defined in mixsets.

A model file or mixset is included only once; subsequent "use" commands for the same file will be ignored. Preceding a mixset name with '!' indicates to not use the mixset, and cancels out any previous use statement that requested to use the mixset.

A common technique is to create a 'master' Umple file that does nothing but have a list of use statements.

Parts of an individual class can be specified in separate files, and brought together using several use statements. For example the associations or attributes could be in one (or several) files, and the methods could be in one (or more) additional files.

Another way to decompose a system is to have a 'core' set of files that can be included in several different systems using 'use' statements.

Use statements function similarly to 'include' statements in other languages.

A file referred to by a use statement must be in the same directory as the file that has the use statement, or in a parent directory, or in a subdirectory named lib.

Umple also ships built-in library files for common modeling patterns. Load one with the lib: prefix. The file is read from inside the Umple compiler, so it does not need to be in your project directory:

use lib:AbstractionOccurrence.ump;

The built-in pattern libraries are:

Each of those pages shows the pattern definition and an example of applying it in a model.

A use statement can also load a .ump file from the web. The argument must be an https URL that ends in .ump. A raw file on GitHub is a typical source:

use https://raw.githubusercontent.com/umple/umple/master/umpleonline/umplibrary/reusable/AbstractionOccurrence.ump;

Example

use Core.ump;
      

Load the above code into classic UmpleOnline
Load the above code into UmpleOnline V2

 

Syntax


// Use statements allow incorporation of other Umple files. See UseStatements
useStatement : use [use] ( , [extraUse] )*