This documentation is intended for language engineers using or extending the use case diagram (UCD) language. A detailed documentation for modelers who use the UCD language is located here. We recommend that language engineers read this documentation for modelers before reading the other documentation.
The module described in this document defines a MontiCore language for UCDs.
This module contains
- one grammar and
- a generated symbol table infrastructure including functionality for creating symbol tables and (de-)serializing symbol tables.
Figure 1: The graphical syntax of an example UCD.
Figure 1 depicts the UCD Example in graphical syntax.
It contains all syntactic UCD elements supported by this MontiCore language.
In textual syntax, the UCD is defined as follows:
usecasediagram Example {
@Player --
Play,
Pay,
ChangeProfilePicture;
@AndroidPlayer specializes Player;
@IOSPlayer specializes Player;
@Server --
ShowAd,
RegisterScore;
ShowAd extend Play [!isPremium];
RegisterScore extend Play;
abstract Pay include CheckPremium;
CreditCard specializes Pay;
Bank specializes Pay;
ChangeProfilePicture [isPremium];
}
The class UCDCLI
provides typical functionality used when
processing models. To this effect, the class provides methods
for parsing, creating symbol tables, storing symbols, and
loading symbols.
The class provides a main method and can thus be used as a CLI. Building this gradle project yields
the executable jar UCDCLI, which can be found
in the directory target/libs. The usage of the UCDCLI tool and detailed instructions
for building the took from the source files are described here.
This module contains the grammar UCD.mc4.
The grammar UCD contains the basic constituents to define textual representations of UCDs. A detailed documentation of the grammar can be found in the artifact defining the grammar.
The grammar defines the syntax for
- UCD artifacts,
- UCDs,
- use cases,
- actors, and
- include and extend relations.
The grammar extends the grammars
- MCBasicTypes for reusing package declarations and import statements.
- CommonExpressions to be able to use boolean expressions, e.g., a && b.
- MCCommonLiterals to be able to use boolean literals in expressions.
There are not context conditions for the language.
The UCD language defines the symbol kinds UCDUseCaseSymbol and UCDActorSymbol.
UCD export instances of these symbol kinds.
UCDs do not import any symbols.
The language uses the symbol table infrastructure generated by MontiCore as it is without handwritten modifications.
The UCDGlobalScope contains UCDArtifactScopes. Each UCDArtifactScope instance contains exactly one DiagramSymbol for the UCD.
Further, each UCDArtifactScope instance contains exactly one UCDUseCaseSymbol for each use case defined in the UCD and one
UCDActorSymbol for each actor defined in the UCD.
The language does not reuse any symbol kinds. It only uses the symbol kinds defined by the language.
UCDUseCaseSymbol for use cases and UCDActorSymbol for actors.
none.
Each UCDArtifactScope instance contains exactly one UCDUseCaseSymbol for each use case defined in the UCD and one
UCDActorSymbol for each actor defined in the UCD.
The DeSers generated by MontiCore are not changed by any handwritten modifications.