简单的C ++ UML w /逆向工程

时间:2021-08-15 10:16:13

I need a way to build C++ code from UML diagrams and vice versa.

我需要一种从UML图构建C ++代码的方法,反之亦然。

Should be simple too hopefully. I don't mind paying too much.

应该简单太希望了。我不介意付出太多。

5 个解决方案

#1


7  

You could try Sparx Enterprise Architect but the code quality would be average, not excellent.

您可以尝试Sparx Enterprise Architect,但代码质量是平均的,而不是很好。

I am not aware of any great automatic code generators for C++

我不知道有任何伟大的C ++自动代码生成器

Prices start from $135

价格从135美元起

#2


1  

Visio is slow, and ate a whole weekend's worth of work one day. Don't use it for UML.

Visio很慢,有一天吃了整个周末的工作。不要将它用于UML。

I've used UMLStudio in the past -- it's cheap, and it did a decent job of reverse engineering my C++ code to make diagrams. It's a little wonky to use, but it's fast as hell once you get into the spirit of the thing.

我过去曾经使用过UMLStudio - 它很便宜,而且它对我的C ++代码进行逆向工程以制作图表做得不错。使用起来有点不稳定,但是一旦你深入了解事物的精神就会很快。

It will also generate code, but I was mainly in "make pretty diagrams" mode, rather than a full round-trip back and forth attempt to use UML like architecture astronauts say it should be use.

它也会生成代码,但我主要是在“制作漂亮的图表”模式,而不是完全往返来回尝试使用UML像架构宇航员说应该使用。

#3


0  

Visio also supports this.

Visio也支持这一点。

#4


0  

Not the answer you are looking for, but if the UML is that simple, then just write the code by hand, you will have far more control over you project in the long run. If you are wanting to use this as a technique to save large amts of repetitive typing, then on the face of it is sound like you may have a design problem to be addressed first.

不是您正在寻找的答案,但如果UML就这么简单,那么只需手动编写代码,从长远来看,您将对项目有更多的控制权。如果您想将此作为一种技术来节省大量的重复键入,那么从表面上看,您可能首先要解决设计问题。

I am slightly biased, as I would also say that if the UML is too complex then write the code yourself anyway, in fact I would seldom recommend generating code from UML.

我有点偏颇,因为我也会说,如果UML过于复杂,那么无论如何都要自己编写代码,事实上我很少会建议从UML生成代码。

UML is a modeling tool, it is not a programming language and should be language agnostic. You need be clear that those 2 concepts are different. Just because in your UML Model have a conceptual class, does not mean that when it comes to implementing that model that you need to create it as a class for various reasons ( Performance, Language constraints etc )

UML是一种建模工具,它不是一种编程语言,应该与语言无关。你需要清楚的是,这两个概念是不同的。仅仅因为在你的UML模型中有一个概念类,并不意味着在实现该模型时你需要根据各种原因将它创建为一个类(性能,语言约束等)

In short, let the design tools help you design, and the dev tools dev.

简而言之,让设计工具帮助您设计,开发工具dev。

#5


0  

Borland Together was quite good for this when I used it during a c++ course. The instructor recommended it, and it did seem to be quite feature-rich, but I'm unsure how much it costs.

当我在c ++课程中使用它时,Borland Together非常好。教练推荐它,它似乎确实功能丰富,但我不确定它的成本是多少。

#1


7  

You could try Sparx Enterprise Architect but the code quality would be average, not excellent.

您可以尝试Sparx Enterprise Architect,但代码质量是平均的,而不是很好。

I am not aware of any great automatic code generators for C++

我不知道有任何伟大的C ++自动代码生成器

Prices start from $135

价格从135美元起

#2


1  

Visio is slow, and ate a whole weekend's worth of work one day. Don't use it for UML.

Visio很慢,有一天吃了整个周末的工作。不要将它用于UML。

I've used UMLStudio in the past -- it's cheap, and it did a decent job of reverse engineering my C++ code to make diagrams. It's a little wonky to use, but it's fast as hell once you get into the spirit of the thing.

我过去曾经使用过UMLStudio - 它很便宜,而且它对我的C ++代码进行逆向工程以制作图表做得不错。使用起来有点不稳定,但是一旦你深入了解事物的精神就会很快。

It will also generate code, but I was mainly in "make pretty diagrams" mode, rather than a full round-trip back and forth attempt to use UML like architecture astronauts say it should be use.

它也会生成代码,但我主要是在“制作漂亮的图表”模式,而不是完全往返来回尝试使用UML像架构宇航员说应该使用。

#3


0  

Visio also supports this.

Visio也支持这一点。

#4


0  

Not the answer you are looking for, but if the UML is that simple, then just write the code by hand, you will have far more control over you project in the long run. If you are wanting to use this as a technique to save large amts of repetitive typing, then on the face of it is sound like you may have a design problem to be addressed first.

不是您正在寻找的答案,但如果UML就这么简单,那么只需手动编写代码,从长远来看,您将对项目有更多的控制权。如果您想将此作为一种技术来节省大量的重复键入,那么从表面上看,您可能首先要解决设计问题。

I am slightly biased, as I would also say that if the UML is too complex then write the code yourself anyway, in fact I would seldom recommend generating code from UML.

我有点偏颇,因为我也会说,如果UML过于复杂,那么无论如何都要自己编写代码,事实上我很少会建议从UML生成代码。

UML is a modeling tool, it is not a programming language and should be language agnostic. You need be clear that those 2 concepts are different. Just because in your UML Model have a conceptual class, does not mean that when it comes to implementing that model that you need to create it as a class for various reasons ( Performance, Language constraints etc )

UML是一种建模工具,它不是一种编程语言,应该与语言无关。你需要清楚的是,这两个概念是不同的。仅仅因为在你的UML模型中有一个概念类,并不意味着在实现该模型时你需要根据各种原因将它创建为一个类(性能,语言约束等)

In short, let the design tools help you design, and the dev tools dev.

简而言之,让设计工具帮助您设计,开发工具dev。

#5


0  

Borland Together was quite good for this when I used it during a c++ course. The instructor recommended it, and it did seem to be quite feature-rich, but I'm unsure how much it costs.

当我在c ++课程中使用它时,Borland Together非常好。教练推荐它,它似乎确实功能丰富,但我不确定它的成本是多少。