Zero Friction Configurations

time to read 1 min | 195 words

Today I broke down and added this to my windsor.boo config:

serviceAssemblies = ( Assembly.Load("MyApp"), )
for asm in serviceAssemblies:
  for type in asm.GetTypes():
    continue unless type.NameSpace == "MyApp.Services"
    continue if type.IsInterface or type.IsAbstract or type.GetInterfaces().Length == 0
    Component(type.FullName, type.GetInterfaces()[0], type)

I was staring at the task of adding two lines to a config file that is less than a 100 lines (including imports & spacing), but that would have been an extra step that I needed to take, and I had intended to create three or five services in the next hour or so. At that point, I couldn't live with having to go into that extra step of adding a line per service.

It is not the line itself that is bothering me, it is the need to remember adding it. Stuff should just happen the way I want it to. I really like that Binsor give me the ability to just go and change the convention of the configuration at will, and that would do for now.