Thursday, March 19, 2009

StarUML for Generating Java, C#, C++ code

This morning as I was doing research on building bridges to ontologies based on semantic distance and I thought about using StarUML to develop the UML products that I need for both my papers, books, projects and grant work. In the past, I used Visio for such things, but I wanted to do something different and be more immersed into the open source world. Here at http://sourceforge.net/project/screenshots.php?group_id=152825 you can download the application from Sourceforge.net. Figure 1 shows the UI.

Figure 1. StarUML with SVD C# Class

I decided to try out the application by reverse engineering a C# singular value decomposition class that I am modifying for another research paper. Below is a sample of the code generated from the class.
//
//
// Generated by StarUML(tm) C# Add-In
//
// @ Project : Untitled
// @ File Name : SingularValueDecomposition.cs
// @ Date : 3/19/2009
// @ Author :
//
//

public class SingularValueDecomposition {
private double[][] U ;
private double[][] k;
private double[][] V ;
private double[] s ;
private int m ;
private int z;
private int n ;
public SingularValueDecomposition(GeneralMatrix Arg){
}
private double[] SingularValues{
get{
}
}
private GeneralMatrix S{
get{
}
}
public virtual GeneralMatrix GetU(){
}
public virtual GeneralMatrix GetV(){
}
public virtual double Norm2(){
}
public virtual double Condition(){
}
public virtual int Rank(){
}
private void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context){
}
}

The application works but as you can see sometimes the code needs to be edited, but it does support UML 2.0. I am going through and looking at the bugs in the reverse engineering part. Since the source code is available-written in Delphi, it provides an opportunity to make changes to the application. For a full list of features, consult http://staruml.sourceforge.net/en/about-2.php . As you can see, there are many possible enhancements that can aid in the development of code. I plan to now use this for my UML artifacts.

1 comment:

Anonymous said...

Hi,
Please could you tell me whether you can you can generate delphi code from UML diagrams with the StarUML tool?
Thanks
Greg