C# Dependency Injection frameworks [duplicate] - c#

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Which .NET Dependency Injection frameworks are worth looking into?
Hi,
As a new kid in the C#/.NET block just moved in from Java neighbourhood, I am looking for options in Dependency Injection/IoC frameworks for .NET/C#.
From Scott Hanselman's blog post few years ago I got a fairly long list of DI frameworks, but there was really not enough information to go with beyond the list itself (plus a license and a version number) to make any semi-intelligent choice. Nor have I developed a ghestalt of the relative popularity (and thus the community support available) for any of these. And the list itself dates from 2008, which makes it a bit outdated, so I would like to ask kindly SO community for help on this matter.
Please list (or vote for) your favourite DI framework, adding a link to framework official website and please be so kind as to provide some reasoning for helping me and others developers like me to make a choice.
A code sample snippets for declaring and injecting dependencies would be of great help as well.
NB: Please restrict yourselves to one entry per response please, to keep it simple and objective.

I have used Ninject before and got on well with it. There are code samples on the front page of the website.
http://ninject.org/
Edit:
Ninject also supports MVC

Of those I have tried, I like Unity best by far. Easy to use, and feature rich. A note is that it's not supported if you are developing for Windows Phone 7.

Of the list I've tried Unity, StructureMap and Autofac.
I perfer StructureMap, I think it's the most straightforward and easiest to use. (didn't spend much time with Autofac tho since was just messing in my own time)

You could also use MEF, but be aware that MEF is not only for this purpose. Mostly MEF is a little oversized for normal DI scenarios, but very usefull if you intent to develop a extendible app.

Related

C# .NET Plugin Framework

I have been working on a Plugin based application in C#. Stumbled across Managed Extensibility Framework (MEF) but this seems to be obsolete and support is dropped off Prism and other Frameworks.
Are there any alternatives to MEF for .NET Framework? A lot of information around plugins is rather dated and old.
Thanks
MEF is NOT a Dependency Injection Container and for that reason it has been removed. So where to look?
The Unity Container (not to be confused with the Unity game development framework), has long been a very popular container for Prism developers, and is what Brian has used for years.
DryIoc has been a very popular and extremely fast alternative for the last several years and has converted many long term Unity fans because of it's performance and great API's.
Ninject is still supported for the moment for WPF. That said this could change in the future. The project is showing signs of being dead. They haven't had a release in over 2 years, it's not particularly fast, or widely used by Prism Developers.
BYOC (Bring your own container)... Prism 7 introduced a complete abstraction for Dependency Injection. This means that if there is a container that you would like to use, you can implement the IContainerExtension for the container you want and bring that into your project. NOTE for WPF development you would still need to tie that container into the ServiceLocator currently used by WPF. You can read more on that from this blog post on Using "Unsupported" DI Containers
Are there any alternatives to MEF for .NET Framework?
MEF is perfectly fine as plugin framework, no need to look somewhere else.
But you shouldn't also use it as dependency injection container (see Dan's answer).

How to write a good core architecture for a project in ASP.NET MVC

I'm going to have to write a big system in January with ASP.NET MVC3 / C#, and need to know how to write a system that will WORK. I do have a bit of experience with ASP.NET MVC and C# but would not call myself an expert. It needs to be extensible so that I can extend it later with new features. How would one go about this? Is there books that explains this topic in detail or should I use trial and error?
In short I need to know good design practice in my code thats extend-able for the future.
Regards
RaVen
The System will be a community portal with forums ratings etc. Cant say more than that << Company Policy>>, The forums I can manage because of plenty open source options... But the rest is up to me.
SOLID == Great Success
Follow SOLID principles in any project and you'll do well.
With regards to core infrastructure/architechure, SharpArchitecture is a good place to start. It is by no means the perfect solution...BUT they give you a good framework to play with and you can have a working system quickly while learning the concepts that work and don't work over time. Take a look and see what you think. It uses NHibernate, Castle and MVC.
Test Driven development will ensure quality for your project. Be strict with yourself, red green refractor. One of MVCs strengths is that it's easier to test.
Professional ASP.NET MVC 2 is a good starting point, though, I would assume that they'll come out with an MVC 3 edition as well. The NerdDinner tutorial contains a lot of ideas on how to structure your application.
Basic advice: work with the MVC architecture, not against it. Understand your application, especially your data model, and layer that onto your application structure. Typically you'll have a controller per model, but not always.
If you want more detailed advice, you'll need to be more specific about your project. I'd suggest coming up with specific questions about various details of your design as you have them, rather than a single question covering the whole project. The latter probably won't get the kind of response you desire.
you can use my "awesome" demo as a start
http://awesome.codeplex.com
If it's going to have to be extensible, make sure you write tests. You'll save yourself sleepless nights in the long run when you fix something, but ended up breaking the entire system.
As far as how to make things "WORK" - that depends on your ability. Read, and look to improve things, but don't get caught in premature optimization or it will leave you dead in the water.
Based upon your edit and your abilities, it might be wiser to select an open source CMS written in ASP.NET MVC and support it. Your skills are good enough, it sounds like, to learn how to write modules and be part of a larger community. You do not sound like you really want to write the whole thing because you are timid about your skills, deadlines, etc. Whilst learning the ins and outs of a well written piece of software, one day you may choose to write your own or contribute to a core piece of the software. There are several to choose from see my comment above under your question.
edit: I also think this will allow you to just start and not worry about every design paradigm people will throw at you for success.
WhoCanHelpMe is a nice reference application. It's built upon S#arp Architecture which is a good starting point for an MVC-application using domain driven design. That will also help you on the way with wiring IoC and db-stuff.
Remember that not every example and framework will fit your requirements, so do as jFar said, think SOLID and make your own decisions based on principals.
You should also look into MEF for extensibility.

C# Windows Application Developer - 3rd Party Tools [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Scenario
I have recently graduated from university with a degree in Computer Science.
My degree mainly focused on C#.
I want to learn more and get better at what I do.
I notice a lot of companies always want their developers to know and use 3rd party tools.
Question
If I was developing C# Windows Forms applications, what 3rd party tools/libraries/controls etc. would be of use to me and for what reason?
The answer to this question depends on how you define "3rd party tools". I usually take that to mean products from companies other than MS but excluding free open source software. When it comes to 3rd party products (for-profit) I cannot think of any common products that I've used or been asked to learn over the last decade that I've been doing .Net development. Most MS shops I've worked with turn to MS solutions (for good or ill depending on your personal view).
That said, in recent years the number and quality of the various FOSS solutions out there has risen dramatically. I use the following whenever I can:
Logging: log4net
Inversion of Control Container (plus more): Castle Windsor
ORM: NHibernate
Unit Testing: NUnit
Mocks for unit testing: Rhino Mocks
For most of these projects there are many other options, these are just my current favorites. Learn to use these (and WHY they are needed) and you'll be many steps above the average .Net developer (sad but all to true).
The DevExpress and Telerik controls are pretty popular, but not free.
Some 3rd party .Net component providers that I've seen used in companies most often:
Telerik
Infragistics
They are not free. These kinds of providers offer large libraries of controls that you'd pick from to achieve your specific goals.
Many good suggestions here, I would also add a few other categories of tools:
Software configuration management/version control: CVS, Subversion, Git/Mercurial/Bazaar, Perforce, etc. Good use of SCM is essential for professional software development.
Issue tracking: Bugzilla, Trac, FogBugz, etc. I would also consider an issue tracking system to be a critical piece of software.
Documentation: Like it or not, it becomes very handy to know your way around Microsoft Word. Knowing how to manipulate styles, headings, numberings, cross-references, etc. can make your life a lot easier when writing documentation.
You'd probably want to have a look at Silverlight. It's a Microsoft alternative to Flash and uses C#. WPF are also something to look at for interfacing.
It might also be worthwhile looking at MOSS.
I've always liked the Xceed controls. In a lot of cases you could always build your own controls. The biggest advantage to using some of these packages is that it saves you the time and they have also been well tested (if not by the company then by the people that are using them).
I've used a couple of different packages over the years and found that if you can use one it's not that hard to use another. The biggest thing is knowing what is available out there so you don't spend two weeks building something that you could have just paid a few hundred dollars for.
You should know about resharper (helper for VS)
Crystal reports - for reports,
Some Grid tools (google it, there are many - I wouldn't bother to learn until need one)
and study advanced topics like: WCF, WPF
Cruise control or other building tool, bugnet or trac - bug management tools...
And of course - AQtime or other Profiling tools.
.NET Reflector
Hawkeye - The .Net Runtime Object Editor
Infragistics
I'd throw mono in there as well. Since you're looking to give yourself an advantage over other developers and improve your value to companies - having cross platform experience is advantageous as well.
There are a lot of 3rd party controls that will help you achieve more in less time. But I don't think many of them will really improve your coding skills (calling someone else to do all the work doesn't teach you much about how to actually do thise things yourself, but familiarity with them and the ability to learn new libraries is a good skill to practice)
Resharper is good for improving your coding skills (code analysis), coding style (autoformatting), and it's a great refactoring tool. It's expensive, though.
Microsoft do some free code analysis tools for Visual Studio (FXCop for code analysis, and there is also a Static Analysis addin) which will help improve your code quality.
AtomineerUtils (my own addin) encourages excellence in documentation and generally improves your code quality (by encouraging good naming style, etc)
Focus more on the tools used in the software development process. Enterprise Architect is used for designing applications from a high level. Once you design you application's business classes you can generate your classes' skeletons. You will be responsible for you code implementation once the class structure has been created.
For implementation purposes look at several C# platforms mentioned earlier. You want to focus Microsoft's WPF, WCF, WF. WPF is ok but it can not be used prior to .net 3.0 so check your client's requirements. I'm working on a project that targets the .net 2.0 because of restrictions by the client so the applicaiton was designed in WinForms. Silverlight is an option as well.
In addition, read up on design patterns as this will help you avoid creating high maintenance applications. A good book is Design Patterns in C#.
For testing look at the Visual Studio TFS system or third party programs like NUnit. You can google NUnit. This will help you ensure that your code does what you intended it to do on a granular scale.
Also, take a look at some of the source control software avaialbel like Subversion, Rational ClearCase, Visual SourceSafe. For large projects with multiple developers you'll need a source control tool that has multiple branches so that each developer has his or her own sandbox within the source control system.
I'm a big proponent of ComponentOne and use it in my new applications regularly. I find that if you're proficient in .NET winforms in general, C1 are very easy to pick up on and usually do what you want with little effort.
A couple people mentioned Telerik. I demoed it fairly extensively and found them to be a bit more complicated because they contain a ton of configuration options for look and feel. Awesome if you're some sort of graphic designer, but unless you're building the next Windows Media Player, I think it's overkill. The learning curve for the theming seemed a bit much for what I was trying to accomplish.
C1 and Telerik both run about $1000 to $1300 depending on what license you get.
You should also check out the Krypton toolkit. It free and has a lot of nice controls.

Django or Ruby on Rails [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm a C#/.NET developer looking to mess around with something completely different - something LAM(*) stackish for building web apps quickly.
I'm thinking either Django or Rails. I kind of like the Python language better and it seems to be more full-featured than Ruby for statistical, scientific and networking (let me know if you think this is wrong). However, the RoR community seems to be much bigger - which might make it a safer bet. Do you think this is important? Anybody have experience with both RoR and Django?
Update: Specifically I'm looking to be able to build a community finance oriented site quickly. There are definitely a lot of Ruby Gems to speed up the process, but I noticed Pinax on the Django side which looks promising.
I know that Python is already fairly popular for financial/mathematical programming. Anyone else have an opinion?
Update 2: Noticed some comments about ASP.NET MVC. I have in fact done pretty significant work with ASP.NET MVC - a LOB app for Medical Equipment Servicing, and I loved it. It is IMHO a much better and more intuitive way to write web apps compared with ASP.NET web forms. But, I'm really looking for a non-.NET development environment to develop some chops in.
I kind of like the Python language
better and it seems to be more
full-featured than Ruby for
statistical, scientific and networking
(let me know if you think this is
wrong).
If you think you'll need libraries like NumPy or SciPy, probably best to stick with python/django. I've struggled to find ruby equivalents.
However, the RoR community seems to be
much bigger
Bigger is of course not going to be better. I've had great experiences with the django community in terms of support, and the pluggable app ecosystem is maturing quite quickly.
I would also add that I find the django documentation to be very easy to follow.
If you want a quick stack check out Sinatra.
Django will make more sense faster. It has awesome routing, simple file structure, nice clean syntax, not a lot of WTF moments, and understandable ORM functionality.
Rails you will have to dive into. You will battle activerecord. You will try to wrap your head around the many facets of a rails application.
I like them both. Try them both out. They don't take that long to get a feel for. You should ultimately base your decision on a per-app basis and factor in which language has better modules/extensions/gems for what you need.
Since your stated preference is Python, I wouldn't hesitate to recommend Django. The documentation available for Django is top-notch, and the community is very helpful. Browse the django-users archives or hang out in IRC for a while and you'll get a good sense of the support available.
I like Django better because it's less magic, with Rails i feel they pushed the convention over configuration principle too far, so i prefer the more explicit nature of Django.
funny... I'm in the same boat, though perhaps I've been looking around for a bit longer.
I came in from MS-land (C# too) and I went with Django, but only after I tinkered around with Google's AppEngine, which re-introduced me to Python. Django is well organized, internally consistent (as far as I could tell), and well supported with a vibrant community. Python is well organized, internally consistent (as far as I can tell), and extremely well supported with an amazing community.
Anyhow, there's more to rapid Python web development than Django. You might want to search for: python wsgi framework. Pylons and TurboGears offer enormous flexibility and focus on "best of breed" components, web2py appears to have a very cool DAL/ORM that I'm itching to dig into, and web.py and werkzeug (amongst others) are minimalistic and don't try to dictate how you should build your app. And if you're sticking with Django, definitely check out the Pinax project - it might help kickstart your development efforts.
I just finished building a small social networking site with Django for a client. I was new to Python and new to Django, but it was one of the most enjoyable development experiences I've had in a while (even with the headaches of being new to a language and framework). And it only took two weeks.
If you're building this for yourself then I would try both Rails and Django (or one of the other frameworks that c.batt mentioned) to see what feels the most comfortable. I ended up choosing Django/Python because I liked the language. It felt clean and efficient, and you can't argue with the speed at which you can get a bare-bones site up and running.
As mentioned previously, Pinax is great. If anything you get a solid base to build on top of. I found that I had to extend parts of it to get exactly what I wanted, and a couple of sections I decided to code from scratch because the changes would get "hacky" to match what I needed. Other parts, however, are perfect. The private messaging was used out of the box, just with some new templates to match the site.
i'm another C#/.net guy with the same itch to tinker. Django is appealing. Though the development is easy and fun, i've heard some stories about deployment and configuration headaches with both Rails and Django (mostly rails). It's not like just throwing an asp.net app at IIS or PHP at Apache. For those things you can set it and forget it. I'd be curious to get c.batt's comments on his/her experince with deploying django.
Lately I've been looking at Grails. It uses Groovy which is ruby like. It's very easy to develop in and you can build apps as fast as Rails but you get access to the Java platform via the JVM which could come in handy. There's a ton of open source java components you could drop into your Grails app, plenty of the types of components you'd be looking for. It's really not like building a java app. So far it does feel like Rails. Good luck.
You are at a point where you cant make a bad choice!
My personal preference is django, but I know for a fact rails is good too.
I think the best answer is what the BFDLs of django themselves say:
Try both, use whichever you like.
Rails is like Bible. Unless you are a Saint, you do not need to understand it and you probably will never understand; all you need to do is to believe in it.
Since you're a seasoned .NET programmer, you really should look at ASP.NET and MVC before turning to Rails and Django, at least if your goal is to get up-and-running quickly. It's always easier to leverage something that you already know in-depth.
I was in a similar situation recently -- I had a project that I wanted to push out on Windows and Unix, and so rather than leveraging what I know well (Ruby/Rails), I jumped ship and gave Groovy on Grails a go. It was a really rewarding experience, and I'm really glad I did a few small projects in Grails, but in the end I had a tiny fraction of the productivity I did in the environment where I had a few years' experience, even after months of hacking away on Grails.
So, pick up Django, Rails, Lift, or whatever you feel like doing -- it will help expand your mind, and give you different ways to look at solving problems. But if you want to get going quickly, use what you know (.NET) on a platform designed for you (MVC).
You express a preference for Python so I'd go with Django - it's a fine framework. My personal preference is for the alternative, but I'm not you and both options are good.
This is mostly a duplicate of https://stackoverflow.com/questions/91846/rails-or-django-or-something-else, btw
Like others suggest, trying both is one good way, but really, to me, I would base it more on which language you prefer to use. Sure, if it's a web app, you'll do a lot with the framework, but "every" line of code you write will be in that language. Since both frameworks are strong, it's really more a matter of what language you'll be happiest writing code in, day in and day out.
I personally use Rails and love it, but have many friends using Django. When we discuss things, time and again, it boils down more to language than framework. The languages are fairly different, and you'll typically find one you prefer a lot more than the other, at least in my opinion. I had originally thought Python sounded great, learned it, wrote a few things with it, etc., but it just never "clicked" for me. When I first saw Ruby many years ago it seemed a bit odd, but when I revisited it via Rails, it just felt so natural. When I write code in Ruby I feel like I'm pretty much writing English - if I can think of how I think the code should be written, I can pretty much type that and it works. It just fits my brain better.
Community wise, you'll get a lot of different opinions. I don't think being "too big" means it's bad, nor do I think the Ruby community is by any means "too big", especially compared to say the Java community. Ruby and Rails have certainly gone mainstream to some degree, and for those of us who've worked with it for several years, it seems mainstream, but in the grand scheme of things it's actually still fairly small.
Anyway, good luck, and enjoy looking into them and finding what will delight you to work with.
I'm curious. If you are a C# programmer, why have you ruled out Microsoft's MVC?
You have two different needs expressed in your question:
1) Want to try something new
2) Want to build community finance site quickly.
I understand the desire to look at RoR or Django for need 1, but for need 2 I'd expect you would be more productive more quickly with MVC.
Please note I am not saying that EVERYONE would be more productive more quickly nor am I saying that Microsoft's MVP is inherently more productive, just that someone who is currently a C# programmer would be able to come up to speed more quickly on something that uses C#...
Although I've never tried it personally beyond playing around, you might also want to check out ASP.NET with IronPython. Here's a blog post that details it.
I agree with the people who say: try both and use what you like best.
I think Rails will be an interesting experience because of the convention over configuration and forced MVC architecture. Also, I am not sure what people's experience with Django is on StackOverflow, but all of my Rails questions get answered very quickly.
Also keep in mind that you can call a python service to do some statistical calculations if necessary.
Here is an article written by a guy who went from .NET/C# to Rails to Django/Python, and then back to Rails. Might be worth a quick read.
http://blog.carlmercier.com/2007/01/30/why-i-moved-from-ruby-on-rails-to-pythondjango-and-back/
Your question must be : Python or Ruby ;)

Which .NET Dependency Injection frameworks are worth looking into? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Which C#/.NET Dependency Injection frameworks are worth looking into?
And what can you say about their complexity and speed.
edit (not by the author): There is a comprehensive list of IoC frameworks available at https://github.com/quozd/awesome-dotnet/blob/master/README.md#ioc:
Castle Windsor - Castle Windsor is best of breed, mature Inversion of Control container available for .NET and Silverlight
Unity - Lightweight extensible dependency injection container with support for constructor, property, and method call injection
Autofac - An addictive .NET IoC container
DryIoc - Simple, fast all fully featured IoC container.
Ninject - The ninja of .NET dependency injectors
Spring.Net - Spring.NET is an open source application framework that makes building enterprise .NET applications easier
Lamar - A fast IoC container heavily optimized for usage within ASP.NET Core and other .NET server side applications.
LightInject - A ultra lightweight IoC container
Simple Injector - Simple Injector is an easy-to-use Dependency Injection (DI) library for .NET 4+ that supports Silverlight 4+, Windows Phone 8, Windows 8 including Universal apps and Mono.
Microsoft.Extensions.DependencyInjection - The default IoC container for ASP.NET Core applications.
Scrutor - Assembly scanning extensions for Microsoft.Extensions.DependencyInjection.
VS MEF - Managed Extensibility Framework (MEF) implementation used by Visual Studio.
TinyIoC - An easy to use, hassle free, Inversion of Control Container for small projects, libraries and beginners alike.
Stashbox - A lightweight, fast and portable dependency injection framework for .NET based solutions.
Original answer follows.
I suppose I might be being a bit picky here but it's important to note that 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 and 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 behind was all that pesky XML config you had to write! They're pretty much all moving this way now, so I have been 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 to 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 at runtime, but they were more difficult for me to setup and frustration often won the day.
Update
I've been using Ninject 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 would 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 can't see that retro-fitting Ninject into existing 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.
It depends on what you are looking for, as they each have their pros and cons.
Spring.NET is the most mature as it comes out of Spring from the Java world. Spring has a very rich set of framework libraries that extend it to support Web, Windows, etc.
Castle Windsor is one of the most widely used in the .NET platform and has the largest ecosystem, is highly configurable / extensible, has custom lifetime management, AOP support, has inherent NHibernate support and is an all around awesome container. Windsor is part of an entire stack which includes Monorail, Active Record, etc. NHibernate itself builds on top of Windsor.
Structure Map has very rich and fine grained configuration through an internal DSL.
Autofac is an IoC container of the new age with all of it's inherent functional programming support. It also takes a different approach on managing lifetime than the others. Autofac is still very new, but it pushes the bar on what is possible with IoC.
Ninject I have heard is more bare bones with a less is more approach (heard not experienced).
The biggest discriminator of Unity is: it's from and supported by Microsoft (p&p). Unity has very good performance, and great documentation. It is also highly configurable. It doesn't have all the bells and whistles of say Castle / Structure Map.
So in summary, it really depends on what is important to you. I would agree with others on going and evaluating and seeing which one fits. The nice thing is you have a nice selection of donuts rather than just having to have a jelly one.
Autofac. https://github.com/autofac/Autofac It is really fast and pretty good. Here is a link with comparisons (made after Ninject fixed a memory leak issue).
http://www.codinginstinct.com/2008/05/ioc-container-benchmark-rerevisted.html
Ninject is great. It seems really fast, but I haven't done any comparisons. I know Nate, the author, did some comparisons between Ninject and other DI frameworks and is looking for more ways to improve the speed of Ninject.
I've heard lots of people I respect say good things about StructureMap and CastleWindsor. Those, in my mind, are the big three to look at right now.
I use Simple Injector:
Simple Injector is an easy, flexible and fast dependency injection library that uses best practice to guide your solutions toward the pit of success.
I'm a huge fan of Castle. I love the facilities it also provides beyond the IoC Container story. It really simplfies using NHibernate, logging, AOP, etc. I also use Binsor for configuration with Boo and have really fallen in love with Boo as a language because of it.
I spent the better part of a day struggling without success to get the simplest Spring.NET example working. Could never figure out how to get it to find my assembly from the XML file. In about 2 hours, on the other hand, I was able to get Ninject working, including testing integration with both NUnit and MSTest.
I've used Spring.NET in the past and had great success with it. I never noticed any substantial overhead with it, though the project we used it on was fairly heavy on its own. It only took a little time reading through the documentation to get it set up.
I can recommend Ninject. It's incredibly fast and easy to use but only if you don't need XML configuration, else you should use Windsor.
The great thing about C# is that it is following a path beaten by years of Java developers before it. So, my advice, generally speaking when looking for tools of this nature, is to look for the solid Java answer and see if there exists a .NET adaptation yet.
So when it comes to DI (and there are so many options out there, this really is a matter of taste) is Spring.NET. Additionally, it's always wise to research the people behind projects. I have no issue suggesting SourceGear products for source control (outside of using them) because I have respect for Eric Sink. I have seen Mark Pollack speak and what can I say, the guy just gets it.
In the end, there are a lot of DI frameworks and your best bet is to do some sample projects with a few of them and make an educated choice.
Good luck!
I think a good place to start is with Ninject, it is new and has taken into account alot of fine tuning and is really fast. Nate, the developer, really has a great site and great support.
Spring.Net is quite solid, but the documentation took some time to wade through. Autofac is good, and while .Net 2.0 is supported, you need VS 2008 to compile it, or else use the command line to build your app.

Categories

Resources