Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
 
 
Programming Blogs - Blog Catalog Blog Directory
 
 
 

Links

Social

Visual Studio 2010: UML modeling projects

Visual Studio 2010 introduces modeling projects that bring UML diagrams to Visual Studio. Currently it is not possible to generate classes from diagrams automatically but I don’t think it is a problem – good UML diagrams visualize different aspects of system short and clearly and they usually don’t document everything you can find in system. In this posting I will show you how to use modeling projects in Visual Studio 2010.

Creating modeling projects

Modeling projects are created as all other projects. Select New Project from menu and select Modeling Projects from templates pane. There is only one modeling project template called (very originally) Modeling Project. Select it and click Ok.

Visual Studio 2010: Creating modeling project

Modeling project is practically empty when it is created. On the left side of screen you should see UML Model Explorer (you can open it from View => Other Windows menu). To add new objects to UML model just right click on the title with mouse and select object type.

UML Model Explorer

Visual Studio 2010: UML Model Explorer You can see UML Model Explorer on image at right. I took this screenshot after adding some objects to my modeling project so you can see how this window looks like when there is some content.

You can add new objects to you model simply by right clicking on model name and selecting object type you want to add. You can define object attributes and assign values to its properties right in the UML Model Explorer.

As a next thing let’s see some example diagrams I created. There are some features I miss (like saving diagrams as image files) but diagramming works pretty fine for program in beta status. Here are my example diagrams.

Adding new diagram

New diagrams are added to model just like any other file in other projects. Just select Add new item and select item type. You can click on image below to see it at original size.

Visual Studio 2010: Add new diagram to modeling project

You can see in the item types list all diagrams you can add to modeling project. I am not very sure if this list is final or not because some diagram types are missing. But let’s hope the best as always.

Adding items to diagrams

After adding new diagram or opening existing ones you can add objects to diagram. You can find objects specific to diagram from toolbox. Screenshots below show you toolboxes for activity, class and user case diagrams.

Visual Studio 2010: Activity diagram toolbox Visual Studio 2010: Class diagram toolbox Visual Studio 2010: Use case diagram toolbox

Class diagram

UML class diagram shows classes in system (or subsystem) and relations between classes. Modeling projects show also attributes and methods of classes. I created simple class diagram that visualizes Party generalization and shows how this generalization can easily connect addresses to Person and Company classes.

Visual Studio 2010: UML class diagram

If you have larger model that doesn’t fit to screen well you can hide members area of classes and save some more room for classes that are not visible otherwise.

Use case diagram

UML use case diagrams illustrate use cases in system (or subsystem) and actors who are related to use cases. Also relations between use cases are shown and commented if needed. My example shows simple registration process where user is identified by its digital passport and then approved by adminitrator when registration data is saved.

Visual Studio 2010: Use case diagram

Activity diagram

As final example here is my activity diagram. It is simple one and it only shows you how activity diagrams look like – don’t look for any deep thoughts from this example.

Visual Studio 2010: Activity diagram

There are also some good news about modeling projects. If you read Code stubbing with Visual Studio 2010 UML modeling thread from Visual Studio 2010 Beta 2 forums you can find out that modeling projects are built as easily extensible parts of projects and Microsoft is working also on code generation features. So, stay tuned – something big is happening!


kick it on DotNetKicks.com pimp it 顶 Progg it Shout it
Shout it!

Comments

PimpThisBlog.com said:

Thank you for submitting this cool story - Trackback from PimpThisBlog.com

# November 4, 2009 5:17 AM

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# November 4, 2009 5:18 AM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# November 4, 2009 5:18 AM

progg.ru said:

Thank you for submitting this cool story - Trackback from progg.ru

# November 4, 2009 5:19 AM

9eFish said:

9efish.感谢你的文章 - Trackback from 9eFish

# November 4, 2009 5:21 AM

Servefault.com said:

Thank you for submitting this cool story - Trackback from Servefault.com

# November 4, 2009 5:22 AM

Visual Studio 2010 and .Net Framework 4.0 - Gunnar Peipman's ASP.NET blog said:

Pingback from  Visual Studio 2010 and .Net Framework 4.0 - Gunnar Peipman's ASP.NET blog

# November 4, 2009 5:30 AM

uberVU - social comments said:

This post was mentioned on Twitter by xgluxv: NEW: Visual Studio 2010: UML modeling projects - http://is.gd/4MM42, #design #modeling #visual studio 2010

# November 4, 2009 6:07 AM

Visual Studio 2010: UML modeling projects - Gunnar Peipman's ASP … Scripts Rss said:

Pingback from  Visual Studio 2010: UML modeling projects - Gunnar Peipman's ASP … Scripts Rss

# November 4, 2009 6:21 AM

balapraveen said:

Thanks to show this new feature... eager to work on it...

# November 4, 2009 7:03 AM

Developer Art said:

From the first look at it, I thought I saw it somewhere. Then I remembered.

It looks very much like diagrams you would find in the good old Rational Rose.

All good comes back?

# November 4, 2009 8:13 AM

Remco Ros said:

@Developer Art

UML was never gone.

# November 4, 2009 9:04 AM

Twitter Trackbacks for Visual Studio 2010: UML modeling projects - Gunnar Peipman's ASP.NET blog [asp.net] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Visual Studio 2010: UML modeling projects - Gunnar Peipman's ASP.NET blog         [asp.net]        on Topsy.com

# November 4, 2009 3:48 PM

Reflective Perspective - Chris Alcock » The Morning Brew #470 said:

Pingback from  Reflective Perspective - Chris Alcock  » The Morning Brew #470

# November 5, 2009 3:31 AM

Visual Studio 2010: UML modeling projects « Jasper Blog said:

Pingback from  Visual Studio 2010: UML modeling projects « Jasper Blog

# November 5, 2009 4:03 AM

Dot Net Technologies said:

More promising features of VS2010

# November 5, 2009 10:43 PM

Mickel said:

Hi, nice article! Do you know if there is any way to export/save the diagrams as PNG/JPEG or such?

Thanks

# November 6, 2009 5:23 AM

DigiMortal said:

Hi Mickel! You can copy the diagram as image to clipboard and save it using any grpahics program. Just right click on the diagram and choose copy as image (or something like that). You can also paste the image directly to documents that support graphics pasting.

# November 6, 2009 6:42 AM

Tom said:

Why don't I have this template installed? Nor can I find it online? I would really like to check this feature out but it seems it has not been installed with my VS2010!

# November 9, 2009 10:35 AM

DigiMortal said:

Hi Tom!

What version of VS2010 do you have? I have VS2010 Ultimate Beta 2 installed and it contains those architecture projects too.

# November 11, 2009 3:56 AM

Mike said:

VS2010 Professional Beta 2  don't have UML modeling tools?

# November 26, 2009 3:07 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)