External Alias vs. Reflection vs. System.Addin For Multi-DLL Testing?
Let's say I have two DLL's, one is a development DLL, another is a production DLL. I want to write so开发者_开发知识库ftware 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).
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.
精彩评论