Visual Studio code snippets were brought up a couple times today. Which reminded me of the only two snippets I’ve ever written and used. I think they’re useful to save me some typing. In C# whenever you have some class that is holding onto unmanaged resources, or even a lot of managed resources, you really need to make it IDisposable. The problem is it’s a fair amount of repetitive typing to get there.
A Generic Factory in C#
July 11, 2008There is this really popular OOP design pattern that we at Tranxition, and other developers elsewhere, use frequently. Years ago, after reading about the factory pattern in the GOF book I immediately thought of some possible uses for it in my work. I was really excited to code it up… the first time. After having writing the code for one factory though, it was clear to me it should just be a library and there were some things overlooked by most example implementations.
Posted by cgassib
Posted by cgassib