public Blog<BenR>

Ben Reichelt's Blog

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Blogs

Subscriptions

Post Categories



Code Generation

I know this was posted awhile ago but, I have to say, code generation is a very good thing.

I wasn't sure how to go about doing it the right way, but finally ended up using the same technique described in the article. You publish a class file, Foo_Generated.cs, which contains all published code. You then hand code a file Foo.cs, that inherits Foo_Generated.cs. You can put anything you want into Foo.cs, and still have all the power of republishing the generated file. I'm using this technique in our current project at work, and one file that I created in a matter of minutes has over 2000 lines of code in it!!! If I had to do all that by hand, it would've taken sooooo much longer, and there would have undoubtedly been many many typos and mistakes. So, hand typing all the nasty plumbing code = 5 hours, generating the code so you can start beer friday a little earlier.........priceless.

posted on Wednesday, December 01, 2004 8:07 PM by reic0113





Powered by Dot Net Junkies, by Telligent Systems