Java中的简单动态调用图 [英] Simple dynamic call graphs in Java

查看:214
本文介绍了Java中的简单动态调用图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个简单的Java动态调用图记录器,您可以在几行代码中添加它。我知道有一个 Aspect J解决方案。另外,我帮助Zola开发 Glow for C / C ++ ,这样我就可以重写一个类似的工具,但我不想深入研究JVM内部。

I am looking for a simple dynamic call graph logger for Java that you can add in a few lines of code. I know there is an Aspect J solution. Also, I helped Zola develop Glow for C/C++ so I could rewrite a similar tool but I don't want to dig into JVM internals.

现在任何开源解决方案都比AspectJ解决方案稳定且更好?

Any open source solution out there right now that is stable and better than the AspectJ solution?

目的是作为伴侣使用单元测试代码的某些部分,以获得有关其行为的更多信息。

The purpose is to use as a companion to unit testing certain portions of the code that you want more information about their behavior.

推荐答案

可能偏离主题,但你确定要实际调用图形吗?不知何故,我认为这样一个详细的图表在合理大小的应用程序中将毫无用处。我觉得更有用的是类之间的依赖图,只要你使用某种依赖注入就很容易获得。我使用谷歌guice(它实际上非常有用的重组/保持清洁一个合理大小的应用程序)。

Maybe off-topic, but are you sure you want actually call graph? Somehow I think such a detailed graph will be next to useless in a reasonably sized application. What I find much more useful is a dependency graph between classes, one that is very easy to get as long as you use some kind of dependency injection. I used google guice (and it was actually pretty useful to restructure/keep clean a reasonably sized application).

有一个非常好的google-guice-dependency grapher,开箱即用,免费: http://code.google.com/p/google-guice/wiki/Grapher 。我甚至自定义它(扩展Grapher类)来标记不同颜色的不同类类型(DAO,控制器,API等)......

There is a very nice google-guice-dependency grapher available out-of-the box and for free: http://code.google.com/p/google-guice/wiki/Grapher . I even customized it (extended the Grapher class) to mark different class types with different colors (DAO, controller, API etc.)...

这篇关于Java中的简单动态调用图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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