For a simple application that use asp.net mvc 3 and .net-4, what service locator application is preferred, with performance concern in mind?
views:
199answers:
3
+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
2010-08-02 01:45:39
Even for a simple application, that don't use plugins, just IoC? What about performance in comparison to a simpler IoC container?
stacker
2010-08-02 01:48:50
+3
A:
See these questions:
- http://stackoverflow.com/questions/1926391/ioc-container-working-with-asp-net-mvc-2-0
- http://stackoverflow.com/questions/2778438/good-ioc-frameworks-to-use-with-asp-net-mvc
- http://stackoverflow.com/questions/532233/asp-net-mvc-fluent-nnibernate-what-ioc-tool
About performance, none of the main IoC containers have performance issues in a web application.
Mauricio Scheffer
2010-08-02 01:53:21
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
2010-08-02 20:19:36
@stacker: nothing relevant has changed. Any of those IoC containers can be used as a mvc3/.net4 service locator.
Mauricio Scheffer
2010-08-02 20:40:04
+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š
2010-08-05 09:47:41
And how is this simpler than using an IoC and not suffering the inconveniences of using the ServiceLocator?
Hadi Hariri
2010-08-05 14:39:19
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š
2010-08-11 04:33:38