具有设计模式统计数据的示例项目

发布于 2024-11-25 02:55:05 字数 324 浏览 2 评论 0原文

我实现了一个可以分析 C# 源代码并检测设计模式的工具。我尝试用很少的测试用例来验证该工具,并且运行良好。我想在检测设计模式时找到误报和漏报的数量。

因此,为了进一步评估该工具,我正在搜索一些现有的开源项目及其中实现的设计模式的统计数据。 统计数据如..

在此处输入图像描述

我可以将该工具的结果与项目给出的这些统计数据进行比较。这将帮助我了解我的工具可以在已经给定的数量中找到多少设计模式。

如果我很少获得此类项目的链接,那将会很有帮助。

提前致谢。

I have implemented a tool that analyses the c# source code and detects the design patterns. I tried to verify the tool with few test cases and it worked fine. I want to find the number of false positives and false negatives while detecting the design patterns.

So to further evaluate the tool I am searching for few existing open source projects with the statistics of design patterns implemented in it.
Statistics like..

enter image description here

I can compare the results of the tool with these statistics given with the project. This will help me to know the number of design pattern my tool can find, out of the already given number.

It would be helpful if I get few links to such projects.

Thanks in Advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷血 2024-12-02 02:55:05

我认为代码并不是关于设计模式的最佳信息来源,因为它与最初的想法有点矛盾。

设计模式只是方向(或想法),而不是可重用组件,否则我们将拥有一大堆名为 DotNetGoF.dll 的库,其中包含所有 GoF 模式。更重要的是,在所有实际应用程序中,所有模式都可以通过业务领域继承的复杂性来隐藏。如果您查看所有编程书籍中的所有示例,您会发现所有这些示例都比具有大量错误处理逻辑等的实际应用程序简单得多。

我认为您需要看看好书或其他书籍资源,例如 Steven John Metsker 的“C# 设计模式”或 DotFactory

编辑:您可以使用.net框架源代码作为设计模式。 .Net框架包含Singletons、FactoryMethods、AbstractFactory、Builder、Decorator、Strategy和许多其他GoF模式。

I think code is not the best source of information about design patterns, because its contradict a little bit from the original idea.

Design patterns is only direction (or idea) but not reusable components, otherwise we'll have whole bunch of libraries called DotNetGoF.dll with all GoF patterns in it. More over in all real-word application all patterns could be hidden by inherited complexity of business domain. If you take a look at all samples in all programming books you'll notice that all those samples is much simpler than real-world application with a tons of error handling logic etc.

I think you need to take a look at good book or another resource, for example "Design Patterns in C#" by Steven John Metsker or DotFactory.

EDIT: you can use .net framework source code as great source of design patterns. .Net framework contains Singletons, Factory Methods, Abstract Factory, Builder, Decorator, Strategy and many other GoF Patterns in it.

玩套路吗 2024-12-02 02:55:05

如果我理解正确的话,您正在搜索包含设计模式的代码库,以查看您的分析工具是否能够检测代码中的设计模式。如果这是正确的,您可以尝试设计模式书籍中的示例代码,例如 -

http://examples.oreilly。 com/9780596527730/

另外,已经有一段时间了,但我似乎记得锐开发的代码库包含许多设计模式,并且有一本书描述程序如何组合在一起,以便您始终可以交叉引用该程序以查看您的工具是否找到正确的位 -

http ://sharpdevelop.net/opensource/sd/

If I understand correctly, you're searching for code bases that contain design patterns to see if your analysis tool will detect the design patterns in the code. If that is right could you try the sample code from design pattern books such as this -

http://examples.oreilly.com/9780596527730/

Also, it's been a while but I seem to remember that the code base for sharp develop contains a number of design patterns, and there's a book describing how the program is put together so you could always cross reference that to see if your tool was finding the correct bits -

http://sharpdevelop.net/opensource/sd/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文