As I keep doing this on MVC projects, thought I may as well blog it, so the next time I need it I can find it myself :) To keep ASP.NET MVC controllers clean and organised, I find it much easier to split them so they handle only a single action each. This helps significantly with maintaining some semblance...
UPDATE: This facility made its way into Castle Microkernel, with name OnCreateFacility. I also made it possible to specify more than one actions. In one of Joshua Flanagan's recent post he mentioned about how they handle application configuration and I have to say that I liked their way. I also liked...
I don't want to be a wet blanket, but someone's got to put a stop to the IoC love fest going on out there. An Inversion of Control (IoC) container , for those of you were aren't yet familiar, allows you to retrieve instances of objects at runtime. A relatively common solution to a common...
Shhh...don't tell anyone but we don't unit test all of our code. We're striving to get all developers and managers on board with unit testing but we're not there yet. Despite our delinquency in writing tests one thing we do try our very best to do is keep mistakes from happening...
Windsor will stitch together objects for you at runtime based on what components have been registered. When you ask for an instance of an object from the Windsor/MicroKernel it will return the object using the constructor it can satisfy. I ran into a problem the other day when I wanted to create...
As the discussion on the altdotnet list continued ( some of it around my blog yesterday ), it became apparent that some people didn't want to use an IoC container - but more confusing was that their objection to the whole pattern was that they thought the IoC container in here meant I was writing...
A discussion on the altdotnet list just came up around logging. After some various suggestions, I asked what was wrong with using optional dependencies and the built in logging facility in Castle Windsor . It seemed the most obvious answer Of course, I completely forgot that when I first tried to figure...
Oren just posted a link to a presentation that he and Hamilton did at JAOO, explaining Castle ActiveRecord and giving some basic examples of its use within an application, and also touching on some trickier aspects of using an ORM. I cannot recommend this highly enough if you are interested in how an...
Update: This is a repost from my old blog, it seemed to have relevance to the recent TypeMock post . It was written for a previous client to help them understand why I was fighting to get Castle Windsor used in their code base. The Problem We currently develop software in a fairly piecemeal and disjointed...
Update: Re-published from old blog I've done it before, but my mind went totally blank yesterday ... due to some typically quick responses from the Castle Users Google Group ... here is the code to do it for future generations to avoid my same silly mistakes ... 1: WindsorContainer container = new...