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

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

问题描述

我们的团队正在对几乎不存在的文档的应用程序进行逆向工程。我们想检测是否使用了建筑或设计模式。您可能会明白这个应用程序很大,所以手动查看对我们来说是没有意义的。

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?

推荐答案

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

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天全站免登陆