Umbrello Handbook X
Umbrello Handbook X
Handbook
Umbrello UML Modeller Handbook
2
Contents
1 Introduction 1
2 UML Basics 3
2.1 About UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 UML Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1.1 Use Case . . . . . . . . . . . . . . . . . . . . . . 5
2.2.1.2 Actor . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1.3 Use Case Description . . . . . . . . . . . . . . . 6
2.2.2 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2.1 Class . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.2.1.1 Attributes . . . . . . . . . . . . . . . . 8
2.2.2.1.2 Operations . . . . . . . . . . . . . . . . 8
2.2.2.1.3 Templates . . . . . . . . . . . . . . . . 8
2.2.2.2 Class Associations . . . . . . . . . . . . . . . . . 8
2.2.2.2.1 Generalization . . . . . . . . . . . . . . 8
2.2.2.2.2 Associations . . . . . . . . . . . . . . . 9
2.2.2.2.3 Aggregation . . . . . . . . . . . . . . . 9
2.2.2.2.4 Composition . . . . . . . . . . . . . . . 10
2.2.2.3 Other Class Diagram Items . . . . . . . . . . . . 10
2.2.2.3.1 Interfaces . . . . . . . . . . . . . . . . . 10
2.2.2.3.2 Datatypes . . . . . . . . . . . . . . . . . 10
2.2.2.3.3 Enums . . . . . . . . . . . . . . . . . . 10
2.2.2.3.4 Packages . . . . . . . . . . . . . . . . . 10
2.2.3 Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . 11
2.2.4 Collaboration Diagrams . . . . . . . . . . . . . . . . . . . 11
2.2.5 State Diagram . . . . . . . . . . . . . . . . . . . . . . . . . 12
Umbrello UML Modeller Handbook
2.2.5.1 State . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.6 Activity Diagram . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.6.1 Activity . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.7 Helper Elements . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.8 Component Diagrams . . . . . . . . . . . . . . . . . . . . 15
2.2.9 Deployment Diagrams . . . . . . . . . . . . . . . . . . . . 16
4
Umbrello UML Modeller Handbook
5 Other Features 31
5.1 Other Umbrello UML Modeller Features . . . . . . . . . . . . . . 31
5.1.1 Copying objects as PNG images . . . . . . . . . . . . . . 31
5.1.2 Exporting to an Image . . . . . . . . . . . . . . . . . . . . 31
5.1.3 Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.4 Logical Folders . . . . . . . . . . . . . . . . . . . . . . . . 32
7 Copyright 35
5
Abstract
Umbrello UML Modeller helps the software development process by using the
industry standard Unified Modelling Language (UML) to enable you to create
diagrams for designing and documenting your systems.
Umbrello UML Modeller Handbook
Chapter 1
Introduction
Umbrello UML Modeller is a UML diagram tool that can support you in the
software development process. Especially during the analysis and design phases
of this process, Umbrello UML Modeller will help you to get a high quality
product. UML can also be used to document your software designs to help
you and your fellow developers.
Having a good model of your software is the best way to communicate with
other developers working on the project and with your customers. A good
model is extremely important for medium and big-size projects, but it is also
very useful for small ones. Even if you are working on a small one man project
you will benefit from a good model because it will give you an overview that
will help you code things right the first time.
UML is the diagramming language used to describing such models. You can
represent your ideas in UML using different types of diagrams. Umbrello UML
Modeller 1.2 supports the following types:
• Class Diagram
• Sequence Diagram
• Collaboration Diagram
• Use Case Diagram
• State Diagram
• Activity Diagram
• Component Diagram
• Deployment Diagram
1
Umbrello UML Modeller Handbook
More information about UML can be found at the website of OMG, http://www.omg.org
who create the UML standard.
We hope you enjoy Umbrello UML Modeller and that it helps you create high
quality software. Umbrello UML Modeller is Free Software and available at no
cost, the only thing we ask from you is to report any bugs, problems, or sugges-
tions to the Umbrello UML Modeller developers at [email protected]
or http://bugs.kde.org.
2
Umbrello UML Modeller Handbook
Chapter 2
UML Basics
• Use Case Diagrams show actors (people or other users of the system), use
cases (the scenarios when they use the system), and their relationships
• Class Diagrams show classes and the relationships between them
• Sequence Diagrams show objects and a sequence of method calls they make to
other objects.
3
Umbrello UML Modeller Handbook
4
Umbrello UML Modeller Handbook
A Use Case describes — from the point of view of the actors — a group of
activities in a system that produces a concrete, tangible result.
Use Cases are descriptions of the typical interactions between the users of a sys-
tem and the system itself. They represent the external interface of the system
and specify a form of requirements of what the system has to do (remember,
only what, not how).
When working with Use Cases, it is important to remember some simple rules:
Use Cases can also have relationships with other Use Cases. The three most
typical types of relationships between Use Cases are:
• «include» which specifies that a Use Case takes place inside another Use Case
5
Umbrello UML Modeller Handbook
2.2.1.2 Actor
An actor is an external entity (outside of the system) that interacts with the
system by participating (and often initiating) a Use Case. Actors can be in
real life people (for example users of the system), other computer systems or
external events.
Actors do not represent the physical people or systems, but their role. This
means that when a person interacts with the system in different ways (assum-
ing different roles) he will be represented by several actors. For example a
person that gives customer support by the telephone and takes orders from
the customer into the system would be represented by an actor ‘Support Staff’
and an actor ‘Sales Representative’
Use Case Descriptions are textual narratives of the Use Case. They usually take
the form of a note or a document that is somehow linked to the Use Case, and
explains the processes or activities that take place in the Use Case.
Class Diagrams show the different classes that make up a system and how they
relate to each other. Class Diagrams are said to be ‘static’ diagrams because
they show the classes, along with their methods and attributes as well as the
static relationships between them: which classes ‘know’ about which classes
or which classes ‘are part’ of another class, but do not show the method calls
between them.
6
Umbrello UML Modeller Handbook
2.2.2.1 Class
A Class defines the attributes and the methods of a set of objects. All objects of
this class (instances of this class) share the same behavior, and have the same
set of attributes (each object has its own set). The term ‘Type’ is sometimes
used instead of Class, but it is important to mention that these two are not the
same, and Type is a more general term.
In UML, Classes are represented by rectangles, with the name of the class, and
can also show the attributes and operations of the class in two other ‘compart-
ments’ inside the rectangle.
7
Umbrello UML Modeller Handbook
2.2.2.1.1 Attributes In UML, Attributes are shown with at least their name,
and can also show their type, initial value and other properties. Attributes can
also be displayed with their visibility:
2.2.2.1.3 Templates Classes can have templates, a value which is used for
an unspecified class or type. The template type is specified when a class is
initiated (i.e. an object is created). Templates exist in modern C++ and will be
introduced in Java 1.5 where they will be called Generics.
Classes can relate (be associated with) to each other in different ways:
8
Umbrello UML Modeller Handbook
9
Umbrello UML Modeller Handbook
2.2.2.3.1 Interfaces Interfaces are abstract classes which means instances can
not be directly created of them. They can contain operations but no attributes.
Classes can inherit from interfaces (through a realisation association) and in-
stances can then be made of these diagrams.
2.2.2.3.2 Datatypes Datatypes are primitives which are typically built into
a programming language. Common examples include integers and booleans.
They can not have relationships to classes but classes can have relationships to
them.
10
Umbrello UML Modeller Handbook
Sequence Diagrams show the message exchange (i.e. method call) between
several Objects in a specific time-delimited situation. Objects are instances of
classes. Sequence Diagrams put special emphasis in the order and the times in
which the messages to the objects are sent.
In Sequence Diagrams objects are represented through vertical dashed lines,
with the name of the Object on the top. The time axis is also vertical, increasing
downwards, so that messages are sent from one Object to another in the form
of arrows with the operation and parameters name.
11
Umbrello UML Modeller Handbook
shown by Sequence Diagrams but there the emphasis is put on how the inter-
actions occur in time while the Collaboration Diagrams put the relationships
between the objects and their topology in the foreground.
In Collaboration Diagrams messages sent from one object to another are repre-
sented by arrows, showing the message name, parameters, and the sequence
of the message. Collaboration Diagrams are specially well suited to showing
a specific program flow or situation and are one of the best diagram types to
quickly demonstrate or explain one process in the program logic.
State Diagrams show the different states of an Object during its life and the
stimuli that cause the Object to change its state.
State Diagrams view Objects as state machines or finite automates that can be in
one of a set of finite states and that can change its state via one of a finite set
of stimuli. For example an Object of type NetServer can be in one of following
states during its life:
• Ready
• Listening
12
Umbrello UML Modeller Handbook
• Working
• Stopped
and the events that can cause the Object to change states are
• Object is created
• Object receives message listen
• A Client requests a connection over the network
• A Client terminates a request
• The request is executed and terminated
• Object receives message stop
• etc
13
Umbrello UML Modeller Handbook
2.2.5.1 State
States are the building block of State Diagrams. A State belongs to exactly one
class and represents a summary of the values the attributes of a class can take.
A UML State describes the internal state of an object of one particular class
Note that not every change in one of the attributes of an object should be repre-
sented by a State but only those changes that can significantly affect the work-
ings of the object
There are two special types of States: Start and End. They are special in that
there is no event that can cause an Object to return to its Start state, in the same
way as there is no event that can possible take an Object out of its End state
once it has reached it.
Activity Diagrams describe the sequence of activities in a system with the help
of Activities. Activity Diagrams are a special form of State Diagrams, that only
(or mostly) contains Activities.
14
Umbrello UML Modeller Handbook
Activity Diagrams are similar to procedural Flux Diagrams, with the difference
that all Activities are clearly attached to Objects.
Activity Diagrams are always associated to a Class, an Operation or a Use Case.
Activity Diagrams support sequential as well as parallel Activities. Parallel
execution is represented via Fork/Wait icons, and for the Activities running in
parallel, it is not important the order in which they are carried out (they can be
executed at the same time or one after the other)
2.2.6.1 Activity
An Activity is a single step in a process. One Activity is one state in the system
with internal activity and, at least, one outgoing transition. Activities can also
have more than one outgoing transition if they have different conditions.
Activities can form hierarchies, this means that an Activity can be composed of
several ‘detail’ Activities, in which case the incoming and outgoing transitions
should match the incoming and outgoing transitions of the detail diagram.
• Text lines
• Text Notes and anchors
• Boxes
Text lines are useful to add short text information to a diagram. It is free-
standing text and has no meaning to the Model itself.
Notes are useful to add more detailed information about an object or a specific
situation. They have the great advantage that notes can be anchored to UML
Elements to show that the note ‘belongs’ to a specific object or situation.
Boxes are free-standing rectangles which can be used to group items together
to make diagrams more readable. They have no logical meaning in the model.
15
Umbrello UML Modeller Handbook
Deployment diagrams show the runtime component instances and their asso-
ciations. They include Nodes which are physical resources, typically a single
computer. They also show interfaces and objects (class instances).
16
Umbrello UML Modeller Handbook
Chapter 3
This chapter will introduce you to Umbrello UML Modeller’s user interface
and will tell you all you need to know to start modelling. All actions in Um-
brello UML Modeller are accessible via the menu and the toolbars, but Um-
brello UML Modeller also makes extensive use of right mouse button context
menus. You can right mouse button click on almost any element in Umbrello
UML Modeller’s work area or tree view to get a menu with the most useful
functions that can be applied to the particular element you are working on.
Some users find this a little confusing at the beginning because they are more
used to working with the menu or tool bars, but once you get used to right
clicking it will greatly speed up your work.
• Tree View
• Work Area
• Documentation Window
17
Umbrello UML Modeller Handbook
18
Umbrello UML Modeller Handbook
small because it is intended to allow you just a quick pick into the element’s
documentation while taking as little screen space as possible. If you need to
view the documentation in more detail you can always open the item’s prop-
erties.
19
Umbrello UML Modeller Handbook
recently used models are also available under the submenu Open Recent in the
File Menu to speed up access to your most frequently used models.
Umbrello UML Modeller can only work on one model at a time, so if you ask
the program to load a model for you and your current model has been modified
since the last time you save it, Umbrello UML Modeller will ask you whether
your changes should be saved to prevent any loss of work. You can start two
or more instances of Umbrello UML Modeller at any one time, you can also
copy and paste between instances.
Using the context menu of the different items in the Tree View you are able to
add, remove, and modify almost all the elements in your model. Right clicking
on the folders in the Tree View will give you options for creating the different
types of diagrams as well as, depending on whether the folder is a Use Case
View or a Logical View, Actors, Use Cases, Classes, etc.
Once you have added elements to your model you can also edit an element by
accessing its properties dialog, which you find by selecting the option Properties
from the context menu shown when right clicking on the items in the Tree View.
You can also edit your model by creating or modifying elements through dia-
grams. More details on how to do this are given in the following sections.
20
Umbrello UML Modeller Handbook
appropriate diagram type from the New submenu in the context menu. Note
that you can create Use Case Diagrams only in Use Case View folders, and the
other types of diagram can only be created in the Logical View folders.
21
Umbrello UML Modeller Handbook
To insert elements that already exist in your model, just drag them from the
Tree View and drop them where you want them to be in your diagram. You
can always move elements around in your Diagram using the Select Tool
The second way of adding elements to your diagram is by using the Work
Toolbar’s edit tools (note that this will also add the elements to your model).
The Work Toolbar was by default located on the far right of the application
window, Umbrello UML Modeller 1.2 has moved this to the top of the window.
You can dock it into other edge or have it floating around if you prefer. The
tools available on this toolbar (the buttons you see on it) change depending on
the type of diagram you are currently working on. The button for the currently
selected tool is activated in the toolbar. You can switch to the select tool by
pressing the Esc key.
When you have selected an edit tool from the Work Toolbar (for example, the
tool to insert classes) the mouse pointer changes to a cross, and you can insert
the elements in your model by single clicking in your diagram. Note that el-
ements in UML must have a Unique Name. So that if you have a class in one
diagram whose name is ‘ClassA’ and then you use the insert Class tool to insert
a class into another diagram you cannot name this new class ‘ClassA’ as well.
If these two are supposed to be two different elements, you have to give them a
unique name. If you are trying to add the same element to your diagram, then
the Insert Class is not the right tool for that. You should drag and drop the
class from the Tree View instead.
You can delete any element by selecting the option Delete from its context
menu.
Again, there is a big difference between removing an object from a diagram,
and deleting an object from your model: If you delete an object from within a
diagram, you are only removing the object from that particular diagram: the
element will still be part of your model and if there are other diagrams using
the same element they will not suffer any change. If, on the other hand, you
delete the element from the Tree View, you are actually deleting the element
from your model. Since the element no longer exist in your model, it will be
automatically removed from all the diagrams it appears in.
You can edit most of the UML elements in your model and diagrams by open-
ing its Properties dialog and selecting the appropriate options. To edit the
22
Umbrello UML Modeller Handbook
properties of an object, select Properties from its context menu (right mouse
button click). Each element has a dialog consisting of several pages where you
can configure the options corresponding to that element. For some elements,
like actors you can only set a couple of options, like the object name and docu-
mentation, while for other elements, like classes, you can edit its attributes and
operations, select what you want to be shown in the diagram (whole operation
signature or just operation names, etc) and even the colors you want to use for
the line and fill of the class’ representation on the diagram.
For most UML elements you can also open the properties dialog by double
clicking on it if you are using the selection tool (arrow). The exception to this is
Associations, in which case a double click creates an anchor point. For associa-
tions you need to use the right mouse button context menu to get the properties
dialog.
Note that you can also select the properties option from the context menu of
the elements in the Tree View. This allows you to also edit the properties for
the diagrams, like setting whether the grid should be shown or not.
In the Attributes Settings page you can add, edit, or delete attributes (variables)
of the class. You can move attributes up and down the list by pressing the
arrow button on the side. This page is always available.
Similar to the Attribute Settings Page, in the Operation Settings Page you can
add, edit, or remove operations for your class. When adding or editing an
operation, you enter the basic data in the Operation Properties dialog. If you
want to add parameters to your operation you need to click the New Parameter
button, which will show the Parameter Properties dialog. This page is always
available
23
Umbrello UML Modeller Handbook
This page allows you to add class templates which are unspecified classes or
datatypes. In Java 1.5 these will be called Generics.
The Class Associations page shows all the associations of this class in the cur-
rent diagram. Double clicking on an association shows its properties, and de-
pending on the type of association you may modify some parameters here such
as setting multiplicity and Role name. If the association does not allow such
options be be modified, the Association Properties dialog is read-only and you
can only modify the documentation associated with this association.
This page is only available if you open the Class Properties from within a dia-
gram. If you select the class properties from the context menu in the Tree View
this page is not available.
In the Display Options page, you can set what is to be shown in the diagram.
A class can be shown as only one rectangle with the class name in it (useful if
you have many classes in your diagram, or are for the moment not interested
in the details of each class) or as complete as showing packages, stereotypes,
and attributes and operations with full signature and visibility
Depending on the amount of information you want to see you can select the
corresponding options in this page. The changes you make here are only dis-
play options for the diagram. This means that ‘hiding’ a class’ operations only
makes them not to be shown in the diagram, but the operation are still there as
part of your model. This option is only available if you select the class proper-
ties from within a Diagram. If you open the class properties from the Tree View
this page is missing since such Display Options do not make sense in that case
In the Widget Color page you can configure the colors you want for the line
and the fill of the widget. This option obviously makes sense only for classes
displayed in diagrams, and is missing if you open the class’ properties dialog
from the Tree View.
3.5.5 Associations
Associations relate two UML objects to each other. Normally associations are
defined between two classes, but some types of associations can also exists
between use cases and actors.
24
Umbrello UML Modeller Handbook
To create an association select the appropriate tool from the Work Toolbar (generic
Association, Generalization, Aggregation, etc.) and single click on the first el-
ement participating in the association and then single click on the second item
participating. Note that those are two clicks, one on each on the objects partic-
ipating in the association, it is not a drag from one object to the other.
If you try to use an association in a way against the UML specification Um-
brello UML Modeller will refuse to create the association and you will get an
error message. This would be the case if, for example, a Generalization exists
from class A to class B and then you try to create another Generalization from
Class B to class A
Right clicking on an association will show a context menu with the actions you
can apply on it. If you need to delete an association simply select the Delete
option from this context menu. You can also select the Properties option and,
depending on the association type edit attributes such as roles and multiplicity.
Associations are drawn, by default, as a straight line connecting the two objects
in the diagram.
You can add anchor points to bend an association by double clicking some
where along the association line. This will insert an anchor point (displayed as
a blue point when the association line is selected) which you can move around
to give shape to the association
If you need to remove an anchor point, double click on it again to remove it
Note that the only way to edit the properties of an association is through the
context menu. If you try to double click on it as with other UML objects, this
will only insert an anchor point.
3.5.6.1 Anchors
Anchors are used to link a text note and another UML Element together. For
example, you normally use a text note to explain or make some comment about
a class or a particular association, in which case you can use the anchor to make
it clear that the note ‘belongs’ to that particular element.
25
Umbrello UML Modeller Handbook
To add an anchor between a note and another UML element, use the anchor
tool from the work toolbar. You first need to click on the note and then click on
the UML element you want the note to be linked to.
26
Umbrello UML Modeller Handbook
Chapter 4
Umbrello UML Modeller is a UML modelling tool, and as such its main pur-
pose is to help you in the analysis and design of your systems. However, to
make the transition between your design and your implementation, Umbrello
UML Modeller allows you to generate source code in different programming
languages to get you started. Also, if you want to start using UML in an already
started C++ project, Umbrello UML Modeller can help you create a model of
your system from the source code by analysing your source code and import-
ing the classes found in it.
In order to generate code with Umbrello UML Modeller, you first need to create
or load a Model containing at least one class. When you are ready to start writ-
ing some code, select the Code Generation Wizard entry from the Code menu
to start a wizard which will guide you trough the code generation process.
27
Umbrello UML Modeller Handbook
The first step is to select the classes for which you want to generate source
code. By default all the classes of your model are selected, and you can remove
the ones for which you do not want to generate code by moving them to the
left-hand side list.
The next step of the wizard allows you to modify the parameters the Code
Generator uses while writing your code. The following options are available:
28
Umbrello UML Modeller Handbook
4.1.1.1.2 Folders Write all generated files to folder. Here you should se-
lect the folder where you want Umbrello UML Modeller to put the generated
sources.
The Include heading files from folder option allows you to insert a heading
at the beginning of each generated file. Heading files can contain copyright
or licensing information and contain variables that are evaluated at generation
time. You can take a look at the template heading files shipped with Umbrello
UML Modeller to see how to use this variables for replacing your name or the
current date at generation time.
4.1.1.1.3 Overwrite Policy This option tells Umbrello UML Modeller what
to do if the file it wants to create already exists in the destination folder. Um-
brello UML Modeller cannot modify existing source files, so you have to choose
between overwriting the existing file, skipping the generation of that particu-
lar file or letting Umbrello UML Modeller choose a different file name. If you
choose the option to use a different name, Umbrello UML Modeller will add a
suffix to the file name.
The third and last step of the wizard shows the status of the Code Generation
process. You need only to click on the Generate button to get your classes
written for you.
29
Umbrello UML Modeller Handbook
Note that the Options you select during the Code Generation Wizard are only
valid for the current generation. The next time you run the wizard you will
need to re-select all the options (your headings folder, overwrite policy, and
so on). You can set the defaults used by Umbrello UML Modeller in the Code
Generation section of the Umbrello UML Modeller settings, available at Set-
tings → Configure Umbrello UML Modeller...
If you have set your Code Generation options to the right settings and want
to generate some code right away without going through the wizard, you can
select the entire Generate All Code from the Code menu. This will generate
code for all the classes in your Model using the current settings (including
Output Folder and Overwrite Policy, so use with care).
30
Umbrello UML Modeller Handbook
Chapter 5
Other Features
5.1.3 Printing
Umbrello UML Modeller allows you to print individual diagrams. Press the
Print button on the application toolbar or selecting the Print option from the
File menu will give you a standard KDE Print dialog from where you can print
your diagrams.
31
Umbrello UML Modeller Handbook
To better organize your model, especially for larger projects, you can create
logical folders in the Tree View. Just select the option New → Folder from the
context menu of the default folders in the Tree View to create them. Folders
can be nested, and you can move objects around by dragging them from one
folder and dropping them into another.
32
Umbrello UML Modeller Handbook
Chapter 6
This project was started by Paul Hensgen as one of his University projects. The
original name of the application was UML Modeller. Paul did all the develop-
ment until the end of 2001 when the program reached version 1.0.
Version 1.0 already offered a lot of functionality, but after the project had been
reviewed at Paul’s University, other developers could join and they started
making valuable contributions to UML Modeller, like switching from a binary
file format to an XMLTM file, support for more types of UML Diagrams, Code
Generation and Code Import just to name a few.
Paul had to retire from the development team in Summer 2002 but, as Free and
Open Source Software, the program continues to improve and evolve and is
being maintained by a group of developers from different parts of the world. In
September 2002 the project changed its name from UML Modeller, to Umbrello
UML Modeller. There are several reasons for the change of names, the most
important ones being that just ‘uml’ — as it was commonly known — was a
much too generic name and caused problems with some distributions. The
other important reason is that the developers think Umbrello is a much cooler
name.
The development of Umbrello UML Modeller as well as discussions as to where
the program should head for future versions is open and takes place over the
Internet. If you would like to contribute to the project, please do not hesitate to
contact the developers. There are many ways in which you can help Umbrello
UML Modeller:
33
Umbrello UML Modeller Handbook
As you see, there are many ways in which you can contribute. All of them are
very important and everyone is welcome to participate.
The Umbrello UML Modeller developers can be reached at [email protected].
34
Umbrello UML Modeller Handbook
Chapter 7
Copyright
35