Sparx Enterprise Architect 转换(从源代码到 UML)
我需要为一个项目制作一个 UML 类图。我过去使用 Sparx Enterprise Architect 从图表生成源代码,所以我正在使用它。
该项目已完成,因此所有代码均已完成,我真的不想手动编写所有类/函数,因此我尝试从源代码生成图表,但似乎找不到方法它。我在网上和他们的网站上进行了搜索,但一无所获。
任何帮助表示赞赏。
I need to make a UML class diagram for a project. I used Sparx Enterprise Architect in the past to generate source code from a diagram so I'm using that.
The project is complete so all of the code is done and I don't really want to write all the classes/functions manually, so I was trying to generate the diagram from the source code but can't seem to find a way to do it. I searched online and on their website but nothing.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
适用于 EA 企业版第 8 版。
打开或创建一个项目。
创建空类图。
菜单选择:
项目->源代码工程->导入文件
目录对话框打开供您选择文件。
我对许多大大小小的 C++ 项目进行了“逆向工程”。您将花费大量时间进行清理。这将取决于项目的质量、结构和代码。
然后,您可以生成一个文档报告(项目 -> 文档),我发现该报告非常有用,即 HTML 报告,用于导航代码。
For Version 8 of EA Corporate Edition.
Open or create a project.
Create empty class diagram.
Menu selection:
Project -> Source Code Engineering -> Import Files
Directory dialogue box opens for you to select files.
I have 'reverse engineered' many C++ projects, large and small. You WILL spend significant time on cleaning up. It will depend on the quality of the project, its structure and code.
Then you can generate a documentation report on it (Project->Documentation) which I have found very useful, the HTML report, to navigate the code.
将代码导入模型的方法称为“逆向工程”。将其放入模型后,您可以制作图表。
It's called "reverse engineering" to import the code into the model. After it's in the model you can make diagrams.
为此,您应该首先使用逆向工程选项,但正如其他一些用户指出的那样,这不是 EA 的强项。我过去尝试过(我认为是 7.3 版本)用 C、Python 和 Java 项目来做这件事,但结果并不总是令人满意。
我不知道你的代码是用哪种编程语言编写的,但是对于C,如果你使用预处理器指令,你的结果将会有很多问题和不兼容。
for that you should first use Reverse Engineering options but as some other users pointed out, this is not a strenght from EA. i tried in the past (version 7.3 I think) to do it with C, Python and Java Projects and the results were not always satisfactory.
I dont know which programming language is your code written in, but as for C, if you use preprocessor instructions, you will have lot of issues and incompatibilities in the result.