我应该如何可视化我的代码结构? [英] How should I visualize the structure of my code?

查看:193
本文介绍了我应该如何可视化我的代码结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Java编写的应用程序。 In存储在多个文件中。它使用不同的类和不同的方法。代码又大又复杂。如果我有一个代码的图形模型(某种有向图),我认为理解代码会更容易。是否有一些标准的代码可视化方法。我正在考虑使用UML(不确定它是一个正确的选择)。任何人都可以推荐一些东西吗?

I have an application written in Java. In is stored in several files. It uses different classes with different methods. The code is big and complicated. I think it would be easier to understand the code if I have a graphical model of the code (some kind of directed graph). Are there some standard methods for visualization of code. I am thinking about usage of UML (not sure it is a correct choice). Can anybody recommend me something?

增加:

我认为有两种可能性:

I consider two possibilities:


  1. 手动创建图形(显式)。

  2. 以自动方式创建图形。例如,使用一些工具来读取可用代码并生成描述代码结构的图形。

ADDED 2 :

免费获得一些东西会很不错。

It would be nice to have something for free.

推荐答案

你应该使用的最重要的工具是你的大脑,它是免费的。

没有理由你必须使用任何类型的标准可视化方法,您可以使用任何您喜欢的媒体。纸,白板,photoshop,visio,powerpoint,记事本:所有这些都可以有效。绘制类,对象,方法,属性,变量的图表 - 无论您认为有什么用于了解应用程序都是有用的。观众不仅是您团队的其他成员,也是您自己。创建有助于您查看和快速理解的图表。将它们发布在您的工作区周围并定期查看它们,以便在构建时提醒您自己的整体系统架构。

There's no reason why you have to use any sort of standard method of visualization, and you can use whatever media you like. Paper, whiteboard, photoshop, visio, powerpoint, notepad: all of these can be effective. Draw a diagram of classes, objects, methods, properties, variables - whatever you think is useful to see in order to understand the application. The audience is not only other members of your team, but also yourself. Create diagrams that are useful for you to look at and quickly understand. Post them around your workspace and look at them regularly to remind yourself of the overall system architecture as you build it.

UML和其他代码文档标准是类型的良好指南您可以做的图表和您应该考虑的信息包括。但是,对于大多数应用程序而言,这是一种过度杀伤力,对于那些无法在没有标准的情况下对文档进行个人责如果您按照UML的说法操作,那么您最终会花费太多时间在文档上,而不是创建应用程序。

UML and other code documentation standards are good guidelines for the types of diagrams you can do and the information you should consider including. However, it is overkill for most applications and basically exists for people who can't take personal responsibility for documenting without standards. If you follow UML to the letter, you'll end up spending way too much time on your documentation instead of creating your application.

这篇关于我应该如何可视化我的代码结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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