Chris Stewart's ASP.NET Blog

My experiences with ASP.NET

Which Dependency Injection Framework?

I'm in the planning phase of a new ASP.NET project.  Currently I'm evaluating the various software components and packages I'm going to use to put this project together.  With all of the hype surrounding Dependency Injection, I've decided to give it a try in this new project.  The two most popular frameworks for DI, as far as I can tell, are Spring.NET and StructureMap.

I'm leaning towards Spring.NET simply because it offers so much more besides DI.  I can, however, appreciate the XML-less features present in StructureMap 2.0.  I'm not sure whether that feature is important enough to choose StructureMap over another offering.

I'm hoping the ASP.NET community can lend some advice as to which framework to use.  Of all of the available options, which would you choose and why?

Comments

Which Dependency Injection Framework? - Chris Stewart's ASP.NET Blog said:

Pingback from  Which Dependency Injection Framework? - Chris Stewart's ASP.NET Blog

# February 7, 2008 1:41 PM

gianluca gravina said:

It seems you've missed one Big "competitor" Windsor Container, I think it's the most used nowadays !

GG

# February 7, 2008 1:47 PM

Jan Van Ryswyck said:

I agree on Castle Windsor. Its really sweet and very easy to use with lots of features. If you don't like  XML configuration, you can use Ayende's Castle Binsor. If you want to get up to speed very quickly, these articles will help you:

blog.bittercoder.com/CategoryView,category,castle.aspx

If you make a choice between StructureMap, Spring.NET or Castle Windsor, I think its more of a personal preference. These frameworks are all very good and very feature-rich, so can't loose when choosing one of these three.

# February 7, 2008 2:50 PM

Chris Canal said:

I use Castle personally and have found it fantastic.  I also use Castle for unit testing in the shape of an AutoMockingContainer (blog.eleutian.com/.../UsingTheAutoMockingContainer.aspx)

# February 7, 2008 3:08 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)