background image
MANAGEMENT AND TECHNOLOGY SCHOOL OF THE POLYTECHNIC INSTITUTE OF BEJA (PORTUGAL), 31 OCTOBER OF 2007
3
(usefull for debugging of proper application
functionality).
The sequence diagram can be visualized
by the application, through Java
TM
Graph-
ics.
Permits to export the diagram to the PIC
[6] language image format by using the
UMLGraph [12] macros for specially de-
sign sequence diagrams. Then we can use a
graphics processing tool like pic2plot [7] to
convert the PIC format to other Image for-
mat such as, PNG, GIF, SVG or PostScript
(PS) [8].
Can export the sequence diagram to the
format of the Sequence tool [9].
There is a simple configuration file to eas-
ily change some variable values defined in
the application so, the program will oper-
ate differently from the pre-established or
what comes by default.
Option to generate Sequence Diagram of a
small part of the code executed by appli-
cation (This is very useful in diagrams of
large application projects).
Option to generate Sequence Diagrams
from a simple trace file description without
the need to write a line of Java
TM
code.
With this feature, the application can be
used to create Sequence Diagrams from
trace files generated from any source pro-
gram.
Fig. 1. Application Screenshot
3
I
MPLEMENTATION
Besides the use of the Java
TM
Debug Interface
to get the Sequence Diagram information, we
needed to incorporate or establish a connection
with other tools and formats or technologies for
further development, sush as:
A XML (Extensible Markup Language)
based format [2] was used to store all
sequence diagram information that can be
easily loaded at any time in the future.
A large part of the export flexibility of
the developed application, was achieved
through the language PIC [6]. This lan-
guage can specify diagrams in terms of
objects such as boxes with arrows between
them and can be translated into concrete
drawing commands by a compiler. This
project uses the pic2plot [7] tool to con-
vert these drawing commands to a binary
image format. Uses a modified version of
the UMLGraph [12] sequence diagram PIC
macros file for the specific purpose of the
application.
Presentation of sequence diagram in the
Sequence tool [9] format.
Presentation of sequence diagram by the
application, through Java
TM
Graphics.
Built-in support for Sequence Diagram
generation
to
Encapsulated
Postscript
(EPS) [1] image format.
4
E
XAMPLE
D
IAGRAMS
Because of the limited space on article, we
will present only a small example (Fig. 2) for
clarification on what may look like a sequence
diagram generated by the application. The re-
spective code is on Listing 1. Note that, in
the example diagram you can see the actual
parameter values passed through the methods.
Listing 1. Java
TM
Code of the Diagram
1
package
p t . i p b e j a . e s t i g . t e s t ;
2
3
4
/
5
C l a s s f o r T e s t i n g t h e A p p l i c a t i o n .
6
u s e s some a r i t h m e t i c t y p e o b j e c t s t o p e r f o r m t h e o p e r a t i o n s .
7
8
A p l i c a c a o de T e s t e p a r a c r i a r um d i a g r a m a de s e q u e n c i a
9
qu e f a z cham adas a v a r i o s t i p o s de o b j e c t o
10
s e r v e de e x e m p l o p a r a f a c i l v e r i f i c a c a o do f u n c i o n a m e n t o
11
d a s v a r i a s c o m p o n e n t e s da a p l i c a c a o em q u e s t a o .
12
13
@au t hor Nuno F o r t e s
14
@ v e r s i o n 1 . 0
15
16
/