none
Is there a way to auto-generate the uml class diagram from code whenever a project is built? RRS feed

Answers

  • Unfortunately the code-->UML transition is very much dependent on you selecting the classes you want to put into the diagram.

    The idea is that, in general, UML diagrams are used for abstractions - so you won't want to make a picture of the whole of the code. Instead, you'd just select the key classes. (If you want to make a picture of all of the code, you can use .NET class diagrams - just open the shortcut menu on a file in Solution Explorer and choose View Class Diagram.)

    So the big question about automating it would be, how would you want the automated version select classes from the code?


    - Alan -MSFT
    Wednesday, October 26, 2011 9:17 PM

All replies

  • You might be able to do this programmatically, see How to: Generate Files from a UML Model


    Esther Fan | Visual Studio, Content Lead | If a post answers your question, please click "Mark As Answer" on that post and mark as Helpful. Thanks!
    Monday, October 24, 2011 4:50 PM
  • Thanks for the info. If I didn't overlook, this article is more on generating code from UML model programmatically (UML --> code) rather than generating UML model from code (code --> UML)...

    Please correct me if I'm wrong.

    Thanks.

    Wednesday, October 26, 2011 6:28 AM
  • Unfortunately the code-->UML transition is very much dependent on you selecting the classes you want to put into the diagram.

    The idea is that, in general, UML diagrams are used for abstractions - so you won't want to make a picture of the whole of the code. Instead, you'd just select the key classes. (If you want to make a picture of all of the code, you can use .NET class diagrams - just open the shortcut menu on a file in Solution Explorer and choose View Class Diagram.)

    So the big question about automating it would be, how would you want the automated version select classes from the code?


    - Alan -MSFT
    Wednesday, October 26, 2011 9:17 PM