7

Are class diagrams automatically updated?

If not, is it possible to do this, so new classes are automatically added and removed/renamed classes are removed from the class diagram? Maybe there's a plugin for this?

lesderid
  • 3,388
  • 8
  • 39
  • 65

1 Answers1

8

Yes, the class diagrams in Visual Studio are kept in sync with the code. You can very easily verify this.

What's more, a class can appear in more than one diagram. All diagrams and the code are synced.

H H
  • 263,252
  • 30
  • 330
  • 514
  • So if I rename a class, the diagram will be changed accordingly? – lesderid Oct 22 '11 at 10:30
  • 2
    Yes. You can also rename the class in a Diagram. But only when using the Solution Explorer you can keep the filename in sync. – H H Oct 22 '11 at 11:04
  • 10
    One thing to add - for me (VS2012) simply reopening the class diagram did not auto update it. I had to select 'View Class Diagram' again from the project's root and *then* my existing .cd file was updated. – atconway Jan 17 '13 at 22:29
  • In VS 2015 the existing diagram was not updated when I added new enums and classes. I had to drag&drop the new enums and classes to the opened window of class diagram and after that they appeared. 'View Class Diagram' option simply generated another new diagram, but didn't updated the existing one. – Daniel Dušek Nov 28 '17 at 06:34