There are dependency injection and service locator patterns. Both patterns can be used with MEF. When using [Import]
or [ImportingConstructor]
, you're using dependency injection. On the other hand, when there' something like this in your code:
var someObject = exportProvider.GetExportedValue<ISomeType>();
you're using service location.
You can choose, which one is more suitable for you. Indeed, real applications often mixes these two patterns.
AFAIK, Prism uses service location at least for the bootstrapper, but Prism doesn't uses any DI-framework directly, because it wants to be independent from the particular DI-framework (there's MEF and Unity support by default). That's why Prism uses adapters for DI/Service location - they're just another level of abstraction.