UML代码生成和模板绑定问题 [英] UML Code Generation and Template Binding Questions

查看:82
本文介绍了UML代码生成和模板绑定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Visual Studio 2012 Ultimate的UML建模工具,我遇到了一些问题.这是我第一次使用VS随附的UML工具.

I got some questions regarding the UML Modelling Tools from Visual Studio 2012 Ultimate. It is the first time I work with the UML-Tools shipped with VS.

(1)我不太了解代码生成过程.它创建的类/接口可能无法编辑,因此几乎没有任何用处.当结构化时,诸如Enterprise Architect之类的其他工具不会改变方法/属性的主体. 图被重新创建. VS覆盖了我的实现.我也不想仅仅为了使UML工具正常工作而创建诸如基类之类的东西.那太疯狂了.

(1) I do not really understand the code generation process. The classes / interfaces it creates may not be edited and thus seem to be hardly of any use. Other tools like Enterprise Architect leave the bodies of methods / properties untouched when a structural diagram is recreated. VS override my implementation. I also don't want to create something like base classes just to make the UML-tools work. That would be rather insane.

(2)不要设法将其绑定到接口的模板参数.根据MSDN文档,我必须创建一个接口,添加一个模板参数,创建一个带有Inheritance-relationship到该接口的类,然后添加一个Template Binding.但是 模板绑定列表始终为空. 无";是唯一要选择的项目.

(2) Don't get it managed to bind to a template parameter of an interface. According to the MSDN docs I have to create an interface, add a template param, create a class with Inheritance-relationship to the interface and then add a Template Binding. But the template binding list is alway empty. "None" is the only item to select.

(3)为什么没有对活动/序列的任何代码生成支持.图表?与Enterprise Architect相比,VS代码生成能力相当有限.

(3) Why isn't there any code generation support for activity/seq. diagrams? Compared to Enterprise Architect, the VS code generation abilities are rather limited...

提前谢谢您.

推荐答案

您说得对,如何从UML模型生成文件.使用第二种方法,您可以编写从活动图和序列图生成代码的代码.

You're right, the code generation feature is not designed as a complete solution. Instead, it's intended as a flexible base that you can build on yourself, either by writing templates, or by taking the slightly different approach described in How to Generate Files from a UML Model. Using the second method, you can write code that generates code from activity and sequence diagrams.

 


这篇关于UML代码生成和模板绑定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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