是否有任何工具可以检测代码中的架构和设计模式? [英] Are there any tools for detecting architectural and design patterns in code?

查看:26
本文介绍了是否有任何工具可以检测代码中的架构和设计模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的团队正在对几乎不存在文档的应用程序进行逆向工程.我们想检测是否使用了架构或设计模式.您可能理解这个应用程序很大,因此手动查看对我们来说没有意义.

Our team is doing reverse-engineering on a application with virtually non-existant documentation. We want to detect if there's a use of architectural or design patterns. You may understand that this application is large, so looking manually is no sense for us.

这个应用程序是用 Java 编写的,我们使用 Eclipse 作为 IDE,所以它可能是 Eclipse 的插件.

This application is written in Java and we use Eclipse for IDE, so it may be a plugin for Eclipse.

我们找到了一些工具,例如设计模式检测相似度评分",但效果不佳.

We have found some tools, like "Design Patterns detections Similarity Scoring", but it's not working very well.

那么,这样的工具确实存在吗?

So, such tools do exists?

推荐答案

如果你有应用的源代码,你很可能正在重新设计它,而不是逆向工程em>.(后者意味着从机器或字节码中恢复某种更高级别的代码).

If you have the source code of the app, you are most probably reengineering it, rather than reverse engineering. (The latter means recovering some sort of higher level code from machine- or bytecode).

无论如何,您都想了解应用程序,即在您的脑海中建立一个心智模型.恐怕自动工具在这方面没有多大帮助.获取代码中假设的模式列表对您有什么用?它是否能帮助您更好地理解代码的实际作用以及为什么?特别是考虑到模式在遗留代码中被滥用的可能性很高:-(

At any rate, you want to understand the application, i.e. build a mental model of it in your mind. I am afraid automatic tools aren't of much help in this. What use would it be for you to get a list of supposed patterns in the code? Would it help you understand better what the code actually does and why? Especially taking into account the high chances of patterns being misused in legacy code :-(

最后,无论如何您都需要认真阅读代码.但这里是另一个类似的线程,希望有助于接管旧应用的艰巨任务.

In the end, you need to get down to reading the code anyway. But here is another similar thread which hopefully helps in the daunting task of taking over a legacy app.

这篇关于是否有任何工具可以检测代码中的架构和设计模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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