Code Generators
bockris: About 4 years ago I was assigned to an internal project that was to provide a GUI CRUD interface in VB.Net to replace one written in curses on Linux.  There were 50-75 attributes for the main entity plus multiple hierachical subsets of sub-entities.  It was a mess.  The business user specified a complex GUI that would let you have different levels of users and allow fields to be protected and show warnings and error by changing the background color of the control, etc, etc.  Tons of boilerplate code and lots of changing conditions because the business user would come up with new requirements and conditions to test for.To keep track of all of this I ended up specifying a lot of the rules in an XML file and used 'Cog' written by Ned Batchelder.   http://nedbatchelder.com/code/cog/ to generate the boilerplate code.  Cog is different than any other code generation tool I had used before because you write your generation code in commented lines in your normal source file.  When you run Cog, it finds these special lines and replaces the code between the markers with whatever code is supposed to be generated.  No other code is touched so it survived a round trip through an IDE like VS.
It worked great for what I was doing and I used it heavily but the project was thankfully cancelled before I could finish.