Reviews

Review: Codify

Codify 1.3.1
$75
Workstate Technologies, LLC
Columbus, Ohio
(412) 436-0603
www.workstate.com

Codify is a code-generation tool for Visual Studio .NET with some interesting features. In particular, it's been designed to encourage code generation on a micro scale. Instead of building entire classes or projects, the creators suggest more modest uses: building a property backed with a static variable, for example, or defining a custom exception class. Codify is aimed mainly at Visual Studio .NET, with implementations for C#, VB .NET, and C++ projects. There's also a standalone FileBuilder that uses the same techniques to create arbitrary disk files.

Codify uses custom templates named CodeBuilders to do its work. CodeBuilders combine scripting (in a language resembling ASP.NET) with parameter schemes that let you enter all manner of data at runtime. When you insert a CodeBuilder into your code, Codify wraps it in a region and adds information on your supplied parameter values in a comment at the top of the region. This lets Codify re-entrantly edit generated code easily. Templates can even contain user code regions: chunks that are not replaced when the code is regenerated, and so which are perfect for customization after code generation.

When you use a CodeBuilder in your project, Codify adds a local copy of the template. That way you can make temporary modifications to the generated code in one project without affecting others that might be using the same template. The product supplies some useful templates to get you started. These range from a builder of simple properties to one that walks an entire SQL Server database, building methods to invoke stored procedures for you.

Codify is fast, works well, and is easy to use once you've got your templates set up. The documentation is a bit sketchy, but the supplied templates include one whose entire purpose is to hold commented scripting code showing off Codify's capabilities. These include examples of property access from the hierarchy of parameters and using the Visual Studio .NET automation model from within your custom code.

Codify is probably the simplest useful code generator that I've seen. If you'd like to give it a spin, there's a 15-day trial version available from the company's Web site.

About the Author

Mike Gunderloy has been developing software for a quarter-century now, and writing about it for nearly as long. He walked away from a .NET development career in 2006 and has been a happy Rails user ever since. Mike blogs at A Fresh Cup.