c# - How to decide which one should we choose to use MEF vs. any IoC? -
in scenario should use what? , in circumstances choose use both together?
tricky question - since 2 indeed overlap degree.
i this:
use useful ioc if you're concerned dependency injection sake of decoupling components, e.g. ability able inject mock instead (for testing)
use mef if you're more being extensible, e.g. able "load assemblies directory export interface", , if need extensible , open third parties (like visual studio: offer public api others can write extension app). mef shines
for mef , unity, there's mef , unity integration layer combine strengths of both tools together.
i recommend check out ayende's excellent blog post on differentiates mef ioc.
Comments
Post a Comment