根据.Net代码自动生成UML Sequence 图。

简介: Sequence Diagram Generator for .NET I was recently asked about programs that can automatically generate sequence diagrams from code.

Sequence Diagram Generator for .NET

I was recently asked about programs that can automatically generate sequence diagrams from code. While this seems like a somewhat trivial task, there aren’t any good ones. I figured I’d share what I knew, tho. Maybe someone else knows of something better.

The first option that came to mind was Visio. I have to admit I’m not a fan of Visio. If you’re designing or documenting network topology, I’m sure it’s great. I don’t do that, tho. I work with software, and Visio is horrible for that. If you want to give it a try, tho, you can export your project from Visual Studio. Unfortunately, this won’t create a sequence diagram for you, so it was even more useless for what I was needing.

The next thing that came to mind was a tool built to do exactly this, SequenceViz. This tool analyzes an assembly and creates a sequence diagram. You’d think the search would be over, but not quite. The problem with SequenceViz is that, if you try to map out anything complex, the diagram is useless. Not because it’s all jammed together; the tool doesn’t scale… at all. Beyond this, the tool has some promise. The only other complaint I really have is the install experience. There are some odd dependencies that aren’t included in the installer, so you have to go hunt them down and install them separately. I hate this. Given the power of WPF, I would’ve preferred to use the capabilities built into .NET.

The next thing I thought about was my favorite modeling environment, Sparx Systems Enterprise Architect. The problem here is the automatic generation thing. To my knowledge, it doesn’t do that. I could be wrong, tho, so if you’re looking for an all-up modeling environment, I recommend you start here. If the price tag is a problem, take a look at StarUML, which is open source. StarUML hasn’t updated in a few years, tho, which is disappointing.

The last tool I found was a Visual Studio add-in called Flow Chart 4 C#. This tool generates a flow chart – not a UML activity diagram – for a given code block. This isn’t exactly what I was looking for and, honestly, I wasn’t impressed. If I were to need something like this, I’d prefer standard UML over some non-standard flow chart visualization.

One thing I’ve wanted for a long time has been a complete MDA environment for Visual Studio. When the domain specific language (DSL) Tools was released, I thought this would be a great tool to help get there, but it seems I’m the only one interested in it. Microsoft has a vision, but it’s at a much higher level. I’m thinking about an almost completely pure MDA approach where you don’t need much code. Most are probably scoffing at this, but I’m not talking about getting rid of code. I’m talking about code = model and model = code. There should be no difference between the two. I’ve put some thought into it, but don’t really have the time to dedicate to working on it. Maybe after a few more side projects.

目录
相关文章
|
7月前
|
存储 测试技术 开发工具
软考中的UML图、数据流图等二十余种示例
软考中的UML图、数据流图等二十余种示例
658 0
|
7月前
|
数据可视化 Java uml
IDEA中一个被低估的功能,一键把项目代码绘制成UML类图
IDEA中一个被低估的功能,一键把项目代码绘制成UML类图
439 1
|
4月前
|
uml
UML 类图几种关系(依赖、关联、泛化、实现、聚合、组合)及其对应代码
UML 类图几种关系(依赖、关联、泛化、实现、聚合、组合)及其对应代码
637 0
|
6月前
|
设计模式 uml
设计模式学习心得之前置知识 UML图看法与六大原则(下)
设计模式学习心得之前置知识 UML图看法与六大原则(下)
49 2
|
6月前
|
设计模式 数据可视化 程序员
设计模式学习心得之前置知识 UML图看法与六大原则(上)
设计模式学习心得之前置知识 UML图看法与六大原则(上)
49 0
|
6月前
|
数据可视化 测试技术 uml
如果更好的绘制UML图
如果更好的绘制UML图
51 0
|
7月前
|
Java uml
UML之组件图(构件图)
UML之组件图(构件图)
208 0
|
7月前
|
设计模式 数据可视化 程序员
不会画uml?推荐使用代码画图的工具PlantUml
不会画uml?推荐使用代码画图的工具PlantUml
647 1
|
7月前
|
程序员 uml
UML图 | 时序图(顺序、序列图)绘制
UML图 | 时序图(顺序、序列图)绘制
817 0
|
7月前
|
设计模式 关系型数据库 程序员
UML中常用设计模式OCP、单例模式、简单工厂模式等模式讲解及C#中代码实现(附源码)
UML中常用设计模式OCP、单例模式、简单工厂模式等模式讲解及C#中代码实现(附源码)
81 0