Faced with choosing a Dependency Injection Framework in a historically MS shop working with C#, I'm interested in finding out the differences between Moq and Unity.
Some of the main concerns would include:
- Ease of use for developers with no background in DI
- Feature comparison between the two (once everyone becomes familiar with the technology).
- Performance (not sure if this is even an issue)
- Integration with visual studio, particularly wi开发者_如何学Cth regards to refactor tools
- Readability / maintainability
- Experience when used with other tools such as MEF or EF
Has anyone had any experience in comparing these two? Does anyone have any reasons for choosing one or the other? Are there any others that I should really be considering as well?
As stated by Robert Harvey, Moq is a library for mocking (i.e. replacing a class implementation with one that always returns predictable results), not a dependency injection framework.
You might use Moq with Unity.
For alternative DI suggestions, try here.
精彩评论