CS2Java - Sourcecode/UML Generator
developed the CS2Java
UML Generator in 2007 within the scope of his Bachelor-Thesis. This wiki-web contains the thesis and a users manual.
The increasing complexity of software systems in the industry and in research, as well as the requirement of reuseability makes documentation of software a necessity for the developer.
The thesis is about the development of a documentation tool for the object oriented CS
framework, which uses the graphical programming language LabVIEW
, and is constructed especially for the development of control systems for large experiments at research instituts worldwide.
The requirements for certain types of documentation and the way of generating it is discussed. Therefore, the useability of the OMG standard XMI is compared to generating source code of a common programming language as an intermediate step.
The result is a code generator, which generates Java source code out of the CS
classes. With an appropriate CASE tool, the Java source code can be used to automatically generate an UML diagram for documentation purposes.
- An installed LabVIEW Version 8.2 on the PC you want to use the tool.
- A CASE Tool of your choice, cf. to thesis tables on page 71/72.
Download the tool from here
, and extract it to your corresponding LabVIEW/ CS
. This is necessary for the program to find the LabVIEW
Start the program with
, this user interface will open up.
- The array
classpaths to classes to be analyzed is used to register the CS classes, from which the Java sources shall be created. If you leave this array empty, all classes in your CS system will be analyzed. You can optionally specify the classpath, or just the classname without any path.
- The button
class or interface generation lets you select, whether the program shall generate Java classes or Java interfaces from the CS classes. This is important if you have multiple inheritance, depending on the way you want it to be displayed later by the CASE tool.
- The field
directory parsed java files lets you determine where to store the generated Java files.
- There are displays which let you know the progress the program has already made when running, and there is a message log for error messages.
- Further you can specify where all the temporary files are stored. There are default values for them all, so you don't have to fill in these fields. Moreover, these files are only important for debugging purposes, so you don't have to bother.
After filling out the fields, you can press the
button. The program will generate the Java files in the desired location.
If you want to display your software system as an UML class diagram, or as another kind of diagram for that matter, you have to use a CASE tool, which generates this diagram. In the thesis on page 71/72 you will find a table, where the attributes of some free CASE tools are listed. I recommend using the JDeveloper
from Oracle, which is a powerful modelling tool, but you can use a CASE tool of your choice.
- Import the Java sourcecode into your JDeveloper project.
- Create a new empty class diagram.
- Drag'n'Drop the whole package of Java source files into the diagram.
- Present your new shiny diagram at the next meeting and enjoy.
- 05 Jun 2008