Marc (34) [Avatar] Offline
Almost every programming problem has multiple solutions.
Is it correct to think of Bait & Switch and IoC as two solutions to the "how do I access device-specific implementations from my common, .Core logic"?
Rather than prepare 3 separate libraries can I put
Mvx.RegisterType<Interface, Implementation>();
in the application-specific Setup.cs files?

It seems to me that creating 3 libraries (what, exactly, is a "library" in this context?) creates more "moving parts" than keeping all the source in 1 solution, and is thus less error prone.


Jim Bennett (82) [Avatar] Offline
Depends on your use case - when building NuGets bait and switch was the best way to go as you just install the NuGet package and everything works, (though with the latest version of VS there is multi targeting -

IoC is for inside your app as you may use it for libraries from somewhere else, or code you've written yourself.