views:

199

answers:

3

For a simple application that use asp.net mvc 3 and .net-4, what service locator application is preferred, with performance concern in mind?

+1  A: 

I would take a look at MEF as it's included on .NET 4.0 and there are several implementations of modularity on MVC using it.

Anero
Even for a simple application, that don't use plugins, just IoC? What about performance in comparison to a simpler IoC container?
stacker
+3  A: 

See these questions:

About performance, none of the main IoC containers have performance issues in a web application.

Mauricio Scheffer
I read already those questions, and other posts. But as you can see, all of those comparison are at least year old, and none of them take .net 4 into account.
stacker
@stacker: nothing relevant has changed. Any of those IoC containers can be used as a mvc3/.net4 service locator.
Mauricio Scheffer
+1  A: 

You don't need ServiceLocator for a simple application. It just works out of the box. Like in previous versions of ASP.NET MVC.

rarouš
And how is this simpler than using an IoC and not suffering the inconveniences of using the ServiceLocator?
Hadi Hariri
I don't understand your question. In simple application you don't need IoC too. You need rewrite your ControllerFactory to use IoC and it is not simpler.
rarouš