NIH > IH or Castle ActiveRecord Rocks
Thursday, November 15 2007
The other day I was on a conference call with my client desperately trying to convince them to let me start converting their application over to using MonoRail. The current implementation is XML and XSLT and a custom front controller implementation and hand written data access layer full of stored procedures. I put together a comparison of using MonoRail vs. the existing framework and I estimated it would take 10x less code to implement the same features. During the debate they asked me how I would feel about replacing a ton of code I wrote, and I tried to convince them that I would be ecstatic!
The first example that came to mind is Castle ActiveRecord. On my last big project we used regular NHibernate. We had a boat load of mapping files, and we wrote what Dave later extracted as NHibernateRepository. We also implemented our own validation engine which Dave later extracted as EVIL. A week ago while I was working up this example I started using Castle ActiveRecord and it does everything we tried to do, only better. There are no mapping files, you get the full benefits of NHibernate, and it encapsulates all of the logic in the model. Then I started using the built in validations and was again impressed, they do a better job then EVIL. As soon as I got through that example application I realized I would never use NHibernateRepository or EVIL again, and I was excited!
Now, some people would keep using what they wrote. This is called Not Invented Here syndrome. But I would love to use something that is Not Invented Here over something that is Invented Here. (NIH > IH) Why? Well for one Castle ActiveRecord is in my opinion better. Another good reason is that more than one team is working on and using the code. Another good reason is that when I leave the project people will have forums and other developers they can ask for help, etc. etc.
Due to scheduling I lost the debate with my client, but I plan on vigorously renewing it in two months.
-James
Comments
- #1 Scott Watermasysk on 11.15.2007 at 6:42 AM
-
I get myself in trouble all the time because I am more than willing delete/rebuild/etc anyone's code (including my own :).
I think the ability to scrap something when it is not "right" even if you are personally invested in a vital quality in software development (and life).
There are of course the people who always want to re-do it for the sake of making it perfect which is a different kind of problem.
Have you ever read "The Dip"? My favorite quote from it is "Average is for losers". Kind of fits IMO. - #2 Ben Scheirman on 11.15.2007 at 8:24 AM
-
It's also important to stress that while a different approach might yield 10x less code, that's code they've already invested in (good or bad) and they already have it.
I think you'll find more success if you target the pain points, such as the cost of adding the next feature, or the cost of vNext, etc... then you can start to paint a picture using $'s rather than LOCs.
I hope you have success though, this is is a all-too-familiar situation :) - #3 David Fauber on 11.15.2007 at 6:34 PM
-
"During the debate they asked me how I would feel about replacing a ton of code I wrote, and I tried to convince them that I would be ecstatic! "
Haha, this brought a smile to my face.