MVC Storefront: Best Episode Yet Is On It’s Way Monday
I sat today with Jeremy Miller (the Shade Tree Guy – what does that mean anyway?) for 2 whole hours as we replumbed the site to work with StructureMap. I know I’ve been saying I want to go with Unity, but a couple of key features of StructureMap pushed me in the other direction – I talk about this more in the screencast.
I <3 Dependency Injection
It’s a buzzword, unfortunately, but I have to say that once you “get it”, it’s rather magical. I have two hours of pair programming with Jeremy Miller sitting here on my desktop, begging to be edited and I hate to touch any of it. For so long I’ve wanted to squeeze one of these Alt.NET guys brains and burn out some code so I finally “get it”.
Not to say that I don’t get DI – I do. But the extent of what you can do with it is rather stifling and I just flat didn’t know it. Jeremy is brilliant at explaining things, and after a few minutes of plugging things in and watching it go, I started to mutter to myself, something along the lines of “what have I been doing this whole time”.
Now I may read this in 3 years time and laugh (DI could be 2008’s DataSets) but for now, I’m enjoying my shiney new toy
.
Plugging this in has allowed me to clean things up tremendously, and feel ever happier about the way this is coming together.
Careful Editing
Now my task is to distill 2 hours of geeking out into concise, watchable stuff. It’s not easy – I don’t want to leave anything out. I’ll ask for your patience with this – suffice to say I’ll be working all weekend on it to get it just right.
I hope you’re looking forward to this as much as I am, and I hope I give you reason to look at DI/TDD in a whole new light.
Finally, there are a lot of great DI frameworks out there that do roughly the same things. Unity is great in terms of a quick setup and ease of use. There’s also Spring, Ninject, and of course Windsor.
It’s up to you which one you want to use, and I’m not trying to push StructureMap over any other. The main reason I went with it is because Jeremy was willing to sit with me and talk me through all of it.
I should also mention that Chris Tavares of the Unity Team did this as well, but a bug in Vista managed to turn off his microphone during our recording session! So I lost it all.
Many thanks to Chris and Jeremy for their help – can’t wait to get this pushed!
Tags: aspnetmvc







