Structuremap, AutoFac, or Ninject, which one is great for a large scale web app?
Solution 1
I think there is no differences between them! Its associated on your-self. Every body has some favorites, and you too. I use StructureMap
and its good enough for large and/or small scale applications.
UPDATE:
Well, a few months ago I met with Simple Injector which is really really simple, and actually fast. I've used it in several projects with different scales, and it really works perfectly.
Solution 2
This article has a good summary of most popular IoC frameworks and discusses their performance as well as ease of use. All in all a great read!
http://philipm.at/2011/di_speed.html
& a follow-up at http://philipm.at/2011/di_speed_redux.html
Solution 3
If you are interested in HOW they are used in large scale web apps, one good one to look at is OrchardCMS; it uses Autofac.
Solution 4
I've only really looked at / used Ninject and simply haven't bothered looking at any others. The simplicity in usage & it's low learning curve fit my last couple of projects very well. IMO, it is a great IoC container for projects large and small.
Solution 5
I've used Unity (some time ago), AutoFac and StructureMap and prefer StructureMap, specifically for its AssertConfigurationIsValid
method which I use in unit tests to, well, assert that my StructureMap configuration is valid (relevant if you're using constructor-based DI).
As far as I'm aware only StructureMap offers this facility.
When using ASP.NET MVC, I also like how the StructureMap NuGet package wires things up for you nicely.
Related videos on Youtube
amiry jd
My other SO-Profile: https://stackoverflow.com/users/974276/j-amiry I am a hard-working and innovative developer with near 18 years of experience mostly based on .NET (Framework & Core) technology stack. For the last few years, alongside developing some awesome applications, I was focused on some non-coding tasks such as building up development teams, team leading, tech leading, problem solving, consulting, architecting, reviewing other's code, and mentoring. As a self-motivated fast-learner experienced code-guy, who has a proactive personality to step up to new challenges, I think I'm the man who can get the job done.
Updated on April 16, 2020Comments
-
amiry jd about 4 years
I have some experience in working by
Structuremap
. And now I'm creating a big and large scale web app (really a social networking site) usingASP.NET MVC 3
,Entity Framework 4.1 code-first
,SqlServer 2008
, viaC#.NET 4
. Which one ofStructuremap
,AutoFac
, andNinject
would you suggest me to use in this case? Performance and easy-of-use is important. Thanks to any help, idea and suggestion. -
Marc L. over 12 yearsNopCommerce is a widely used (very scalable, used for some very large installations) open-source e-commerce engine that uses Autofac as well (it recently moved off of Unity).
-
amiry jd over 12 years+1 A good and perfect article. So thanks
-
Adam Tuliper over 12 yearsit is a good article, but beware of the unity comments from an invalid test.
-
mdonatas about 11 yearsAdditional post about IoC framework performance palmmedia.de/Blog/2011/8/30/… with benchmark code at GitHub github.com/danielpalme/IocPerformance
-
Victor Yarema about 6 yearsIt seems to me that the follow-up is even more important than the first article.
-
joe about 4 yearsSimple injector is good...but with push-developers-into-best-practices. It requires you to go for best practices in many cases. This might be a good point to a new project(for example, you are only allowed to have one public constructor), but it can be hard to adapt to existing projects that don't follow those practices.