代码存根与Visual Studio 2010的UML建模 [英] Code stubbing with Visual Studio 2010 UML modeling

查看:259
本文介绍了代码存根与Visual Studio 2010的UML建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我在探索我的方式通过所有添加到Visual Studio 2010 Beta 1的IDE中的新功能,我发现一个特点,希望能成为对我帮助很大。 UML建模工具的架构版本。我想创造一个新的测试项目,没什么特别的。我开始了创建一个标准的UML逻辑类图。我说完后,然后我想我的图,以C#代码导出带班存根,但我无法弄清楚如何做到这一点。所以很自然我咨询MSDN,但我无法找到设计的自上而下的方法任何参考和排序的放弃了它。然后,我正好是第9频道网站上,我看到了自上而下的架构的视频,他们提到的Visual Studio 2010能够完成这个任务的可能性。



所以我想我的问题是,可以Visual Studio 2010中采取逻辑类图,并从它生成的代码存根?



我目前使用Visual Studio 2010 Beta 1的团队系统在Windows 7(有没有什么帮助的话)。



感谢您


解决方案

尝试从RC文档以下主题:




  • 如何从一个UML模型



    生成文件

    从UML模型,可以生成程序代码,模式,文件,资源和其他任何形式的
    文物。从UML模型生成文本文件中的一个方便的方法是使用
    文本模板。这些让您将要生成文本中的程序代码



  • 自定义使用配置文件和定型型号




    您可以适应标准的UML模型元素,如类和组件,定制它们用于特定用途的
    。您可以将构造型,可以改变属性的元素的
    名单的模型元素。刻板印象的集合称为配置文件中定义的。





您可能还检查了这个博客通过后蒂姆·费希尔帮助的如何在VS生成Team System的UML图码2010团队系统测试版2(更新4)




下面是关于如何使用T4文本模板,以产生从UML的图表代码的第一代码段




下面是另一篇博客中通过奥列格Sych发表: UML建模和代码生成在Visual Studio 2010




假设读者已经熟悉UML,它着重于定制UML概要文件 - 一个$可用于UML模型调整到一个特别的问题
域b $ b扩展机制。读者会看到这样一个配置文件,它扩展了UML类图对
数据库建模的例子。最后,本文介绍了如何代码可以从UML模型使用
T4文本模板生成。




我贴得更在我的个人资料获得更多信息。


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.

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.

这篇关于代码存根与Visual Studio 2010的UML建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆