用于多 DLL 测试的外部别名、反射、System.Addin?
假设我有两个 DLL,一个是开发 DLL,另一个是生产 DLL。我想编写一个软件来比较每个 DLL 中各种函数的结果。
目前,我正在使用外部别名,这是一个非常好的解决方案,但它需要大量的代码重复(这是我遇到的问题类型:在外部别名之间切换而不重新编写代码?)
所以现在,我正在考虑使用反射或 System.Addin (将 DLL 视为插件)。在我开始弄清楚哪个更适合我的软件之前,我想知道你们是否都有解决此类问题的经验,以及你们决定使用什么解决方案。这是我正在开发的系统的一个非常关键的部分,因此让它以尽可能最好的方式工作非常重要。
我真的很感谢任何评论,谢谢!
编辑:最重要的是,我想必须有一种“最佳实践”方法来测试两个 DLL 的结果。这一定是人们经常做的事情(我猜)。
Let's say I have two DLL's, one is a development DLL, another is a production DLL. I want to write software that compares the results of various functions from each DLL.
Currently, I am using external aliases, which is a pretty nice solution, but it is requiring a lot of code duplication (this is the type of problem I'm encountering: Switching Between External Aliases Without Re-Writing Code?)
So now, I'm considering looking into using reflection or System.Addin (treat DLL's as plugins). Before I start figuring out which would be better for my software, I was wondering if you all have any experience with this type of problem, and what solution you decided to use. This is a very critical part of the system I'm developing, so getting it to work the best way possible is important.
I really appreciate any comments, thanks!
Edit: Bottom line, I imagine there has to be a "best practice" way to test the results from two DLL's. This has to be something that people do quite frequently (I would guess).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否考虑过使用 Unity 或其他依赖注入框架?这是此类框架的主要用例。 Unity 可以在 (Unity on Codeplex) 找到,它是 Microsoft 模式和实践项目。
Have you considered using Unity or another dependency injection framework? This is a primary use case for such a framework. Unity can be found at (Unity on Codeplex) and is a Microsoft Patterns and Practices project.