Generating class code from VS2010 UML class diagram within a non-modelling project

I am trying to write some T4 templates to generate basic class definitions from my physical UML class diagram that lives in my domain project. However, all of the T4 examples I have seen on the web for generating code from UML class diagrams are based on modeling projects (.modelproj). Is it possible to use T4 templates to examine and generate code for UML class diagrams that ARE NOT within a VS2010 modeling project? I cannot use use class diagrams in a modeling project as they are logical and hence any class properties are restricted to four primitive types.

Answers


There are 2 kinds of Visual Studio class diagram: the UML .classdiagram files that can only be opened in a .modelproj project; and the .NET class diagrams that you can get from a code file using the "View Class Diagram" command in Solution Explorer. I'm not quite clear which one you're working with, since if you've got the latter kind, you'd already have some code.

BTW, you can actually use properties of any type in a UML class diagram. In the model explorer, right-click to get the shortcut menu on the root node, and choose Add External Type. You can enter any namespace and type name. Then that type appears in the menu for setting the types of class properties.


Need Your Help

Why does a blurry image appear in a simple android camera app?

android android-camera android-imageview

I tried to make a simple camera app that captures an image and views the image in an imageview:

Extraction from a string in R or Python

python r

I have a csv file with addresses that include ',', empty space, numbers. I have two other files with city and zip codes. I want to read the address file and extract the city name and zip codes. A...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.