6

I need a program to design UML class diagrams and generate C# code from it.
My goal is to build an UML class diagram for some personal project and generate the backbone of my code with it.

For instance, the software would allow me to build a class diagram like this: class diagram

And generate the following code from it:

public class Component 
{
    public void operation()
    {
    }
}

public class ConcreteComponent : Component
{
    public void operation()
    {
    }
}

public class Decorator : Component
{
    private object component;
    public void operation()
    {
    }
}

public class ConcreteDecorator : Decorator
{
    public void operation()
    {
    }
}

An additional much appreciated feature would be the possibility to generate the code with System.Collections attributes to implement UML composition or aggregation.

The software I'm looking for needs to run on Windows 7 and 8(.1) 32-bit and 64-bit and I don't mind the price.

4
  • Welcome to Software Recommendations! We will need much more information to give good recommendations here. Please take a look at What is required for a question to contain "enough information"? Then please edit your question and see if you can incorporate some of these improvements. May 28, 2014 at 17:27
  • I added some details hoping this will help.
    – Chris
    May 28, 2014 at 17:46
  • Of course I did. I added an example of code based on UML class diagram.
    – Chris
    May 30, 2014 at 11:50
  • If you're going to add more detail to the question, add things like do you need a WYSIWYG type tool, support for sequence diagrams, diagram generation from code, etc. You don't need to explain UML and code generation because those are well defined terms in software development. Jun 2, 2014 at 13:42

5 Answers 5

3
+50

Visual studio 201X is your best choice.

http://msdn.microsoft.com/en-us/library/dd409445.aspx

The VS Diagram desginer is a UML tool that I've used for years.

enter image description here

4

ArgoUML is a freeware UML modeling tool that may work for you. It's primarily focused on Java development but it does have the option to generate code in C#.

ArgoUML code generation

3
  • Thanks for your answer, do you know if this project is still active? On their site I see that the last version is from december 2011.
    – Chris
    May 28, 2014 at 20:03
  • 1
    It may not be. I've used off and on since 2005 and I've not had any problems with it. May 28, 2014 at 20:10
  • Just wanted to add that I have used ArgoUML and really liked it; lots of features and pretty solid program. Unfortunately, it doesn't seem to be active anymore, but it is still worth checking out for all the good features.
    – Bill W
    Apr 6, 2018 at 16:19
3

WhiteStarUML

It's in active development, has been around for a few years now, it's Open Source and the current maintainer does listens. Plus, it's easy to use, and it has the undo/redo feature that ArgoUML is missing.

http://sourceforge.net/projects/whitestaruml/

1
  • Interesting project, good rating on sourceforge.
    – Chris
    May 30, 2014 at 7:03
2

Modelio is basically a free & open source UML modeling tool which is active and UML2 compliant.

The free edition of Modelio does not provide C# code generation support however the commercial version of Modelio supports it. The commercial version is distributed by Modeliosoft. You can use it with the C# Designer module which provides C# code generation feature.

enter image description here

2

Sparx Systems Enterprise Architect does a good job of this too...

They have a free booklet with in-depth information on how code generation and reverse engineering works with Enterprise Architect.

There are also third party plugins.

It's been around a long time and is well supported. There is also a lot more information out there.

2
  • Please read our discussion on what makes an answer high quality to see if you can incorporate some of these improvements into your answer. Given the not great question a bunch to work off a bunch of those aren't really relevant but it could still be improveed with like why are you recommending it etc. Sep 9, 2014 at 11:37
  • 1
    Better Nick? A simple google query... google.com.au/… Would give you the same information. I didn't state it because it's not hard to find once you know the name of the product.
    – Mick
    Sep 10, 2014 at 0:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.