Skip to main content

Which .NET Dependency Injection frameworks are worth looking into?


Which C#/.NET Dependency Injection frameworks are worth looking into? And what can you say about their complexity and speed.



Source: Tips4allCCNA FINAL EXAM

Comments

  1. I suppose I might be being a bit picky here but it's important to note DI (Dependency Injection) is a programming pattern and is facilitated by (but does not require) an IoC (Inversion of Control) Framework. IoC Frameworks just make DI much easier, but it's not only DI that they do, they provide a host of other benefits over and above DI.

    That being said, I'm sure that's what you were asking: about IoC Frameworks: I used to use Spring.Net and CastleWindsor a lot, but the real pain in the beehiind was all that pesky XML config you had to write! They're pretty much all moving this way now, but I started using StructureMap for the last year or so, and since it has moved to a fluent config using strongly typed generics and a registry, my pain barrier in using IoC has dropped below zero! I get an absolute kick out of knowing now that my IoC config is checked at compile-time (for the most part) and I have had nothing but joy with StructureMap and its speed. I won't say that the others were slow (runtime), but they were more difficult for me to setup and frustration often won the day.

    I believe they're all moving towards a more strongly typed config now - or at least providing the option, but some people love putting all the config in XML - personally I can't bare it, so I have stuck to StructureMap now.

    I can't comment much on Ninject except that I listened to Nate on one of the Herding Code podcasts and he's one switched-on guy, and the screencasts I've watched have really tempted me to try it out - maybe on the next project - who knows.

    Update: In a follow up to my comments here, I've been using Ninject (as promised) on my latest project and it has been an absolute pleasure to use. Words fail me a bit here, but (as we say in the UK) this framework is the Dogs'. I highly recommend it for any green fields projects where you want to be up and running quickly. I got all I needed from a fantastic set of Ninject screencasts by Justin Etheredge. I also can't see that retro-fitting Ninject into existing (above average) code being a problem at all - but then the same could be said of StructureMap in my experience. It'll be a tough choice going forward between those two, but I'd rather have competition than stagnation and there's a decent amount of healthy competition out there.

    Other IoC screencasts can also be found here on Dimecasts.

    Hope that helps,

    Rob G

    ReplyDelete

Post a Comment

Popular posts from this blog

[韓日関係] 首相含む大幅な内閣改造の可能性…早ければ来月10日ごろ=韓国

div not scrolling properly with slimScroll plugin

I am using the slimScroll plugin for jQuery by Piotr Rochala Which is a great plugin for nice scrollbars on most browsers but I am stuck because I am using it for a chat box and whenever the user appends new text to the boxit does scroll using the .scrollTop() method however the plugin's scrollbar doesnt scroll with it and when the user wants to look though the chat history it will start scrolling from near the top. I have made a quick demo of my situation http://jsfiddle.net/DY9CT/2/ Does anyone know how to solve this problem?

Why does this javascript based printing cause Safari to refresh the page?

The page I am working on has a javascript function executed to print parts of the page. For some reason, printing in Safari, causes the window to somehow update. I say somehow, because it does not really refresh as in reload the page, but rather it starts the "rendering" of the page from start, i.e. scroll to top, flash animations start from 0, and so forth. The effect is reproduced by this fiddle: http://jsfiddle.net/fYmnB/ Clicking the print button and finishing or cancelling a print in Safari causes the screen to "go white" for a sec, which in my real website manifests itself as something "like" a reload. While running print button with, let's say, Firefox, just opens and closes the print dialogue without affecting the fiddle page in any way. Is there something with my way of calling the browsers print method that causes this, or how can it be explained - and preferably, avoided? P.S.: On my real site the same occurs with Chrome. In the ex