I was just wondering if anyone here uses UML tools to generate codes
from class diagrams. If so, how practical is it to become a good
practice? TIA.
I tried it on some occasions. My experience is, that most of the tools
are not round-trip-capable (even some of them which claim they are).
Means - if you modify something in the generated code, you will lose
your changes on the next generation cycle. I also found it hardly a
time saver. All in all you have to type the method and class names
anyways be it in your tool or directly in code. Plus you are
definitely faster typing than having to click all those dialogs to add
parameters etc. What i found more useful was doing it the other way
around - writing your code and then generate a diagram for
documentation purposes. In general the generation approach only works
as well as the generator you are using. There are some quite
sophisticated free generator frameworks out there (like AndroMDA),
however the idea of painting a diagram, pressing a button and the
generator does all the coding for a finished project is only working
for very few simple cases. There is always an exception to the rule and
generators rarely account for that. Conclusion: if you want to have a
look at MDA/MDD try some of them, but I wouldnt recommend this approach
for anything bigger than a small demo application.
Best regards,
Jan