Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a C++ project that is getting bigger and bigger. I do a lot of UML so it was not really hard to explain my work to co-workers until now. Lately I implemented a lot of new features and I gave up updating by hand my Dia UML diagrams. My code is documented with Doxygen but the generated doc is not really visual.

I would just like my co-workers to quickly understand updates in my class design. Doxygen seems to handle UML diagrams using Graphviz but I would like to know if other possibilities are available and what you guys do to be as clear as possible when showing your code to co-workers (not clients).

share|improve this question
Have you looked at/tried Doxygen? – Jerry Coffin Jun 25 '12 at 23:16
Doxygen + graphviz is a first answer to my question. But I would like to know if other solutions exist. – vanna Jun 25 '12 at 23:27
do you follow any design-patterns in organizing and architecture of this project? – Yusubov Jun 26 '12 at 0:12
Can you be more specific with your requirements? "Clear" and "organized" are not really actionable requirements. What specifically about your existing tools didn't work for you? – Robert Harvey Jun 26 '12 at 4:43
@RobertHarvey : I updated my original post – vanna Jun 26 '12 at 8:35

What you are looking for is called round-trip engineering. There are more and less solid tools available for this.

The basic idea of round-trip engineering is this:

  • You can make a change to the UML diagram in your UML modeling tool, and the change is automatically reflected in a code update (i.e., you add a method to the UML class, and the tool adds the method to the .h and .cpp files as well)
  • You can make a change to the source code and your UML diagram is updated automatically.

While full-blown round-trip engineering is pretty much an ongoing research effort, there are tools out there, which at least partially support it. In particular, such tools usually support converting existing projects and in that process they allow you to create UML diagrams from the current state of the source.

Hence, instead of manually updating your diagrams, you could re-generate them each time you need to show your progress and only waste a little bit of time for layouting, or selecting relevant parts for your presentation. But in particular, you are guaranteed that the diagrams you shown contain exactly the information present in your source code.

For C++ I'm afraid I only know one such tool: Enterprise Architect. I'm sure there are more around, though.

As a final note: Automation at this level is far from being perfect. You will get a decent UML diagram, but certainly not something like you would have derived by yourself. First off, once you leave the realm of static structure and want behavioral diagrams, most tools are not only at a total loss, but produce totally useless output. And second, even for static structure, it is a difficult subject to derive aggregation/composition/association(classes)/etc. automatically from source code. Given that most code generators are still manually tuned to produce the desired outputs in the obvious UML model -> code direction, it is understandably much more difficult to generalize the reverse direction.

share|improve this answer
I was not really specific, check out the updated original post. I am not looking for round-trip engineering tools but a graphical code documentation. – vanna Jun 26 '12 at 8:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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