Having been delving into the world of IoC, SoC and TDD, I find myself extracting an interface more and more often. A little too often… I have quite a few interfaces that exist as nothing more than a crutch. And now using AspView I have even more! Where will this madness end!
I guess this applies to any IoC container, but you get the idea. How would you describe Windsor to a newcomer in just one sentence? I just wrote:
Windsor is a way of passing in different classes to code that is going to use them, it helps you write applications that are very flexible and testable.
But that was pretty off the cuff and I’m not really satisfied with it. Give it a go, it’s pretty hard.
Technology Brainstorm
October 10th 2007, 12:35 am in Agile Development, Castle, Monorail, Personal, TDD, Windsor.
Recently Plastiscenic has been asked to quote for a fairly large project, and if it comes off I’ll have the chance to work on it from the ground up, using whatever technologies I think are best suited.
HotSwap for Monorail - In Action
September 23rd 2007, 12:08 pm in .NET, Agile Development, C#, Castle, Monorail, Screencasts, Windsor.
Ayende quickly posted something called HotSwap, which is a little snippet of code which uses a FileWatcher, Windsor, and on-the-fly code recompilation to increase your productivity. With ASP.NET, building your code changes causes an appdomain restart, and you will typically have to wait a few seconds for the appdomain to come back up before the browser will display your changes. This basically means that when working with ASP.NET, there are no quick code changes - you always have that four second wait till you see the effects.
HotSwap resolves this by building your code for you when it detects a change. Using Windsor it can swap out the old assembly containing your code and replace it with a new dynamically created assembly containing your new code - all automatically. The key advantage of this is that it’s all done in-memory, and none of the DLL files in the bin directory change. This means that you won’t trigger an appdomain restart and your changes can be seen almost instantly!
I was really impressed and excited by this approach so I did a very quick screencast on the topic. I was using the Castle RC3 MSI, and created a project with Windsor integration enabled. This code only works for your controllers at the moment, but a lot of the time that’ll be where you need this kind of productivity boost.
Ayende - cheers for this, and I’m sorry if I pronounced your name wrong as I’ve only seen it written down!
UPDATE: I’ve uploaded the HotswapTest Project from the screencast. You’ll probably need the Castle RC3 MSI installed to build it.
Basic Windsor Usage with the Repository Pattern
September 15th 2007, 4:39 pm in .NET, C#, Castle, Patterns, Windsor.
I’ve been interested in using the Repository pattern in an application for a while now; same goes for Windsor. When prototyping with repositories it became clear that I could use them together in a fairly simple way which would serve as a good introduction to both.