Personally, I steer clear of code generation or round-tripping for the reasons already mentioned (e.g., an editor is more natural for the details). I just find it easier to look at the model and write the code. The only time that I have used this was with ObjectDomain and I think that half of the reason that I used it was to play with Jython since their code generation is based on writing extension classes to walk the model and generate classes.
Generating a model from code is useful if you are trying to figure out how a code base is structured. This is generally useful for Java-based projects since UML is a pretty natural fit for OO languages with introspection - C++ is a different story altogether. The quality of the UML environment makes a difference here but so does the code base itself. I know that the representation of C++ templates is something that very few modeling environments get right. I would expect that Java generics would present a similar problem.
I use UML for few different purposes:
- thinking through a design or architecture
- describing an architecture or tricky design detail to colleagues
- generating diagrams to support a document
The interesting thing is that I use different tools for each of these. I've gone through a number of modelers (in rough chronological order): Objecteering, ObjectDomain, Visio, ArgoUML, Poseidon for UML, and MagicDraw. I use Visio and MagicDraw for most purposes.
When I am in the design phase and thinking through a system architecture or more detailed design, I use UML as a formal tool so I use a true modeler - MagicDraw. I find that constructing a UML model is a good way to capture my thoughts. A side effect of using a real modeler here is that it forces me to think about methods and structure and not just flow. When I am struggling with getting a design right, I force myself to use UML in the most formal sense. Make sure to model everything precisely - for example: asynchronous operations are best modeled as signals and receptions. I struggled with this for a long time. The key here was to understand formal UML and how my chosen modeling tool represented each concept. This is probably the most important take away from this long rant.
When I am using UML as an ad hoc communication tool, trying to describe something to a colleague for example, the most effective tool is really a whiteboard and markers. I find that formal UML isn't that useful here - just the basic structural diagram and sequence diagram stuff. Surprisingly enough a number of these have been saved by camera phone and mailed around to describe various concepts... go figure.
Embedding UML diagrams in documents usually involves Visio though I never use the official UML modeling support. Use Pavel Hruby's stencil instead. The UML model mode of Visio is broken in so many ways that it really isn't worth the money or effort. However, with Pavel's stencil, do ad hoc UML diagrams is quick and easy. The other piece of advice here is to use a vector graphics format instead of a raster format for the images themselves. My company, like many others, is infected by the Microsoft Office virus so I am pretty much stuck with Word for documents. In this case, I use Enhanced Metafiles (*.emf) as my image format of choice. If you are working in a DocBook environment, then use SVG instead.