Merging UML Diagrams in Visual Studio 2010

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

When working with Visual Studio 2010 UML diagrams, sometimes you might want to reuse one diagram created in another solution. For example your colleague has build diagram D1 and you are working in solution which contains diagram D2. Now you want to import the diagram D1 from solution 1 in solution 2.

Simple requirement isn't’ it?

Here is how to do this:

0. Make a copy of the model definition file.
This file can be found in the folder ModelDefinition. In our case this would be Solution2.uml, because we are importing D1 from Solution 1 in the solution 2.

1. Add the UML diagram D1 from solution 1 to solution 2.
Usually, diagrams are consisted of two files. For example D1.componentdiagram and D1.componentdiagram.layout.
First one defines the model and second one is layout.

2. Unload the model project, right mouse click on model project file and choose edit.
This will open the project file as XML.
Lookup the component D1 (in the picture below UMLComponentDiagram1).

image

The arrow shows the line which you have to insert, because this line does not exist after adding of these two file in the project.

4. The last step is the most complicate one. You should manually merge files Solution1.uml and Solution2.uml.
Following picture shows how to do that. Just copy all elements from solution 1 marked as green and paste them at corresponding position in the solution 2. All other elements (gray) can remain, because they are same across all solutions (at least at this moment).
image 

Hope this helps

Visit www.daenet.de


Posted Apr 20 2010, 03:16 PM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.