Search code examples
dependency-injectioninversion-of-controlprismmefautofac

mef or unity is a impretive choice for prism?


Heading for alternative using for prism and di/ioc. mef is skilful framework for prism but not so fast. trying to use autofac for prism because our application infrastructure have to many presentation layer like a web, mobile, tablet(silverlight) and desktop(wpf). mef is not good idea for web(if there is no pluggin operation etc. requirements)

tried mef and autofac together. used aggregate catalog and exposed parts to autofac but it's a not complatetly solution. there is to many problems to be solved. using are together.(prism, prism.mefextensions, prism.autofacextensions and autofac's mefintegration)

using prism.autofacextensions for alternating mef but autofac is not ready to prism i think. tried some alternative projects but not ready. also autofac is not inject import attributed object automatically and not have a scanning tool for directory(export attribute scanner. it's must be coded.) and all prism extensibility must be declared. i think its not ready to use for prism.

is there a any alternative ready to use for prism framework? we must use ioc container for all presentation layers. whats best solution?


Solution

  • Based on my understanding, Unity container supports all the layers you mentioned of ASP.NET Web API, Windows Phone 8, Silverlight and WPF.

    In addition, Bootstrapper implementation and any other feature related to PRISM becomes relatively simple to achieve as PRISM already includes the UnityBootstrapper class which implement most of the required functionality.

    You can find helpful information for Unity container in the following CodePlex Unity site:

    I hope this helps.