简体   繁体   中英

Code stubbing with Visual Studio 2010 UML modeling

Currently I'm exploring my way through all the new features added to the Visual Studio 2010 Beta 1 IDE and I found a feature that will hopefully be of great help to me. The UML Modeling tool in the Architecture Edition. I wanted to create a new test project, nothing special. I started out with creating just a standard UML Logical Class Diagram. Then after I had finished I wanted to export my diagram to C# code with class stubs but I couldn't figure out how to do it. So naturally I consulted MSDN, but I couldn't find any reference to the top down approach of design and sort of gave up on it. Then I happened to be on the Channel 9 website and I watch the Top down architecture video and they alluded to the possibility of Visual Studio 2010 being able to accomplish this task.

So I guess my question is, can Visual Studio 2010 take a Logical Class Diagram and generate code stubs from it?

I'm currently using Visual Studio 2010 Beta 1 Team System on Windows 7 (if that helps any).

Thank you

Try the following topics from the RC docs:

  • How to: Generate Files from a UML Model

    From a UML model, you can generate program code, schemas, documents, resources, and other artifacts of any kind. One convenient method of generating text files from a UML model is to use text templates. These let you embed program code inside the text that you want to generate.

  • Customizing Your Model with Profiles and Stereotypes

    You can adapt the standard UML model elements, such as classes and components, to customize them for specific purposes. You can apply a stereotype to a model element that can change the element's list of properties. Stereotypes are defined within collections called profiles.

You might also check out this blog post by Tim Fischer helps: " How To: Generate Code from Team System UML Diagrams in VS 2010 Team System Beta 2 (Update 4) "

Here is the first code-snippet about how to generate code from UML-Diagrams using T4 Text-Templates. 替代文字
(source: msdn.com )

Here's another blog post by Oleg Sych: UML Modeling and Code Generation in Visual Studio 2010

Assuming that reader is already familiar with UML, it focuses on custom UML profiles - an extensibility mechanism that can be used to tailor UML models to a particular problem domain. Readers will see an example of such a profile, which extends UML Class Diagrams for database modeling. Finally, the article shows how code can be generated from UML models using T4 text templates.

I've posted more links on my profile for more info.

You answer is Visualization and Modeling Feature Pack . This pack gives your what ever you need regarding code generation from Visual Studio 2010 modeling facilities and more.

According to MSFT, the answer is no. Or at least, it is not built in by default though may be delivered by extension. See here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM