i am spending this cold but bright sunday at home, since my mother had a simple surgery-like operation lately. So i am trying to solve some problems today to facilitate my week. One of those is refactoring my C# project by applying dependency injection.
Here is a short video which clearly explains the concept: http://www.youtube.com/watch?v=IKD2-MAkXyQ
My tool choice is ninject, since it is lightweight and does not require to write an xml for configuration. ( Despite being a SOA developer for several years in the past and dealt with bpel for a while, i still do not like using XML as a programming language. Here is an up-to-date discussion about it: http://programmers.stackexchange.com/questions/213316/xml-based-programming-languages )
And it is the Guice equivalent of .net :)) http://stackoverflow.com/questions/10844787/guice-equivalent-in-c-sharp
Here is Ninject home page: http://www.ninject.org/
- how to set up: http://www.youtube.com/watch?v=w_MehI2qBTo
https://github.com/ninject/ninject/wiki/Dependency-Injection-With-Ninject
https://github.com/ninject/ninject/wiki/Contextual-Binding
https://github.com/ninject/ninject/wiki/Contextual-Binding
- a brand new book: http://www.packtpub.com/mastering-ninject-for-dependency-injection/book
a sample chapter named Getting Started with Ninject can be downloaded from Scribd http://tr.scribd.com/doc/170865212/9781782166207-Mastering-Ninject-for-Dependency-Injection-Sample-Chapter
- quick introduction posts: http://www.codeproject.com/Articles/424749/Dependency-Injection-Using-Ninject and http://stefanoricciardi.com/2011/01/21/ninject-mini-tutorial-part-1/
http://stefanoricciardi.com/2011/02/04/ninject-mini-tutorial-part-2/
http://stefanoricciardi.com/2011/02/04/ninject-mini-tutorial-part-2/
- a practical introduction mini-book: http://www.jeremybytes.com/Downloads/DependencyInjection.pdf
- dependency injection in .net book: http://mangadonkey.free.fr/Calibre/Mark%20Seemann/Dependency%20Injection%20in%20.NET%20(29)/Dependency%20Injection%20in%20.NET%20-%20Mark%20Seemann.pdf
which barely mentions Ninject.
- and another article: http://www.dotnetcurry.com/showarticle.aspx?ID=829
Hiç yorum yok:
Yorum Gönder