tags:

views:

688

answers:

5

I need a way to build C++ code from UML diagrams and vice versa.

Should be simple too hopefully. I don't mind paying too much.

+8  A: 

You could try Sparx Enterprise Architect but the code quality would be average, not excellent.

I am not aware of any great automatic code generators for C++

Prices start from $135

Ilya Kochetov
I'll give it a try, Cheers!
CVertex
EA is seconded. I don't use it as I resist using UML as much as possible, but when I did, it worked very well. Code generation should be as good as it gets, considering its creating a C++ version of a UML diagram, there's not much to get wrong.
gbjbaanb
A: 

Visio also supports this.

Raindog
+1  A: 

Visio is slow, and ate a whole weekend's worth of work one day. Don't use it for UML.

I've used UMLStudio in the past -- it's cheap, and it did a decent job of reverse engineering my C++ code to make diagrams. It's a little wonky to use, but it's fast as hell once you get into the spirit of the thing.

It will also generate code, but I was mainly in "make pretty diagrams" mode, rather than a full round-trip back and forth attempt to use UML like architecture astronauts say it should be use.

XPav
A: 

Not the answer you are looking for, but if the UML is that simple, then just write the code by hand, you will have far more control over you project in the long run. If you are wanting to use this as a technique to save large amts of repetitive typing, then on the face of it is sound like you may have a design problem to be addressed first.

I am slightly biased, as I would also say that if the UML is too complex then write the code yourself anyway, in fact I would seldom recommend generating code from UML.

UML is a modeling tool, it is not a programming language and should be language agnostic. You need be clear that those 2 concepts are different. Just because in your UML Model have a conceptual class, does not mean that when it comes to implementing that model that you need to create it as a class for various reasons ( Performance, Language constraints etc )

In short, let the design tools help you design, and the dev tools dev.

Stephen Bailey
A: 

Borland Together was quite good for this when I used it during a c++ course. The instructor recommended it, and it did seem to be quite feature-rich, but I'm unsure how much it costs.

Andy