Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So after a few days of reading and a lot of googling I got it to work. First I tried to find out what IoC (Inversion of Control) actually meant. </p> <p>One of the first sites I found was a website with a screencast about Unity. Which is a DI/IoC framework for .Net.</p> <ul> <li><b>Link:</b> <a href="http://www.pnpguidance.net/Screencast/UnityIoCDependencyInjectionASPNETMVCFrameworkScreencast.aspx" rel="noreferrer">David Hayden screencast on Unity</a>. </li> </ul> <p>Looking at it now this is actually a very good screencast and example on how easy it is to use Unity and IoC/DI. At the time I didn't understand it completely so I went on and kept googling.</p> <p>One website I kept running into was the one from Martin Fowler.</p> <ul> <li><b>Link:</b> <a href="http://martinfowler.com/articles/injection.html" rel="noreferrer">Martin Fowler - IoC Container and the DI pattern</a> </li> </ul> <p>For me, a person that is a coding novice this website is a little to abstract. Also this might sound weird but the font, line-height and typography on that website was really awful which made it even harder to read.</p> <p>The next website I read was about Windsor Castle since Alfredo Fernández said it was easy to use.</p> <ul> <li><b>Link:</b> <a href="http://www.castleproject.org/container/gettingstarted/index.html" rel="noreferrer">Castle Project- Windsor Container</a></li> </ul> <p>The documentation wasn't to bad but I had some problems converting their "getting started" basic example to my Asp.net Mvc application. Also part 2 and 3 were missing from their getting started.</p> <p>After this I started looking for the different frameworks to see if i could find a really basic example. If I just looked at the first screencast again I would have fixed it a lot sooner but somehow I lost track of it.</p> <ul> <li><b>Link:</b> <a href="http://www.hanselman.com/blog/ListOfNETDependencyInjectionContainersIOC.aspx" rel="noreferrer">Scott Hanselman: List of .NET DI Containers(IOC)</a>: very good blog post with most of the .NET IOC solutions. </li> <li><b>Link:</b> <a href="http://haacked.com/archive/2007/12/07/tdd-and-dependency-injection-with-asp.net-mvc.aspx" rel="noreferrer">Phil Haack: TTD and DI using Structure Map</a>: Using the xml configuration file was to complicated for me and i couldn't get it to work.</li> <li><b>Link:</b> <a href="http://blog.andreloker.de/post/2009/03/28/ASPNET-MVC-with-Windsor-programmatic-controller-registration.aspx" rel="noreferrer"> Andre Loker: ASPNET-MVC-with-Windsor-programmatic-controller-registration</a>: Didn't try this example. Looking at it now I might have been able to get it to work.</li> <li><b>Link:</b> <a href="http://www.codeplex.com/MVCContrib" rel="noreferrer">MvcContrib</a>: This adds functionality to Asp.net Mvc. It also has 3 or 4 IOC ControllerFactories build in. I couldn't get it to work I also didn't find a lot of documentation about this.</li> </ul> <p>I had a lot of problems with xml configuration files and I couldn't seem to get them to work. I tried Windsor, Structure Map and Spring.net but I always got stuck with the xml files.</p> <p>So I decided to go to the Asp.net Mvc site because that's where I started learning about Asp.net Mvc. I found the first screencasts and MIX09 presentations very clear and I understood most of what people were talking about. I got stuck at the second screencast by Rob Conery when building the Storefront application. Because I knew a little more about repository and IOC/DI now I thought it would a be a good idea to start watching Rob Conery's screencasts again. In one of the screencasts he talks about uploading all the samples to codeplex.</p> <ul> <li><b>Link:</b> <a href="http://www.codeplex.com/mvcsamples" rel="noreferrer">Codeplex: Mvc sample apps</a></li> </ul> <p>I went to codeplex and found out you can browse through the source files without downloading them. I tried to find out how Rob Conery handles IOC/DI with his repositories. So I was glad to see he was using Structure Map but instead of using a xml configuration file he was using a bootstrapper class that registers all the interfaces to their concrete class. </p> <p>After trying this with my webapplication I finaly was able to get Structure Map to work in my application (Hooray). </p> <p>He also showed me how to fix the dependency on my Product class that comes from Linq to Sql. He creates an extra object that then gets called by "select new product { }" in the Linq queries.</p> <p>Wow, this answer is a little longer than I planned but I hope this helps other people like me who are very novice in coding and Asp.net Mvc.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload