posted on Friday, June 24, 2005 8:43 AM
by
roydictus
Software Factory: The Guidance Automation Toolkit (GAT) for Visual Studio 2005
Visual Studio 2005 really is a dream environment for any serious .NET Solution Architect or Developer. The built-in designers, the great new CLR and the language extensions, super new controls etc. make designing and developing complex applications less of a hassle. And as you may have derived from some of my previous posts, I also really dig automation of mundane tasks such as daily builds, build verification tests and of course coding and documentation of Data Access Layers, collections and the like. Enter Microsoft's Software Factories initiative.
A Software Factory, basically, is any automated process that generates software; be it code, a model, a spec, whatever. Software factories make the process of designing and building software less error-prone, faster and easier, freeing us up to focus on the interesting bits. And one of the absolutely coolest new things in this area is Microsoft's GAT.
The Guidance Automation Toolkit (GAT)
This toolkit is a freely-downloadable package from Microsoft's Patterns & Practices Group. Currently still in an early CTP version, GAT makes extending Visual Studio 2005 a lot easier than using the traditional means -- i.e., creating Enterprise Templates or writing plugins that talk to EnvDTE and the like. With GAT, architects and senior developers create guidance packages for their teams, for instance to auto-generate code and documentation, to quickly implement common domain-specific design patterns, etc., all according to company or team standards.
Without GAT, such guidance is hard to create. With the current version of GAT, it still isn't super-easy (some XML handcoding is still required) but it's already a big improvement and we can be sure that the RTM version is going to kick some serious butt.
GAT contains a set of tools which are really layers on top of Visual Studio's extensibility mechanisms -- actually, to be really purist, GAT builds on top of the Guidance Automation eXtensions (GAX), which form another layer of abstraction on top of Visual Studio's APIs.
For instance, using GAT it's easy to create wizards which connect to databases and auto-generate Data Access Layer (DAL) code, Business Layer code, database schema documentation, etc. In fact, one of the samples of GAT demonstrated at Tech-Ed this year did just that.
At the core of GAT are concepts such as "recipes", "templates" etc. A recipe is basically a template for a use case. Recipes consist of actions which create, modify or delete "artifacts" (such as code or XML) in Visual Studio. Recipes can be parameterized and the parameters' input can be fetched from the user (using wizards), XML configuration files, databases etc. You can group related recipes and templates in Guidance Packages and distribute them in your team or on the Internet.
Part of the GAT is T3, the templating engine with the cool name which will sadly be renamed T4 by RTM for reasons that are probably better left obscure. The T3 templating engine is similar to CodeSmith and uses a syntax similar to ASP's HTML/code mixing: embedding code between <# ... #> tags in output such as XML, HTML or code.
Resources: