Enterprise Templates Booklet


Sheldon Fernandez
Infusion Development Corporation (http://www.infusiondev.com)

October 2003

Applies to:
    Microsoft® Visual Studio® .NET 2003

Summary: Learn how to create Enterprise Templates using Visual Studio .NET 2003. Topics include: creating project templates, enforcing policy, and authoring custom help content for Visual Studio .NET. Corollary topics, such as architecture and modeling, will also be considered. (72 printed pages)


Booklet Outline
Software Requirements
Part I: Creating Enterprise Templates
Part 2: Tangential Topics
Part 3: Architecture and Application Modeling


The primary technologies of the Microsoft® .NET Framework are numerous and impressive; ADO.NET, ASP.NET, XML Web services, .NET Remoting, GDI+, C#, managed C++, and Microsoft Visual Basic .NET all boast significant innovations over their predecessors. So eye-catching were these technologies when .NET was first released that less-intriguing aspects of the framework were widely ignored or underrated. With the second iteration of the .NET Framework (version 1.1), and a lessening of the hyperbole that initially accompanied it, the more mundane, but nevertheless extremely useful, facets of the framework can now be properly considered. This booklet highlights an important technology in the latter group—Enterprise Templates (ET).

Enterprise Templates allow architects and managers to promote and enforce project structures and design patterns in Microsoft Visual Studio® .NET 2003. Simply put, an Enterprise Template prescribes the project skeleton a user receives when he or she creates a project with that template and the characteristics that the IDE enforces for that template (called policy). If you have used Visual Studio .NET in any capacity you have in fact already used templates. Create a Microsoft Windows® Application project, for example, and Visual Studio .NET gives the project an empty form named Form1. Create a ClassLibrary project and the environment gives the project a boilerplate class called Class1. These project types are simply pre-built templates that have been packaged with Visual Studio .NET. With Enterprise Templates, developers can build and expose their own templates that embody specific requirements and characteristics.

A common assumption is that Enterprise Templates define the content and makeup of a custom project type, which is in turn made available to developers. Although this is certainly true, the capabilities of Enterprise Templates go beyond this basic facility. By using this technology, you can execute operations on the fly when a project is created. For example, you can add dynamic content (custom namespaces, boilerplate code) to the files of a project, perform administrative operations during project creation (for example, use the event log to track the projects developers are creating), and even perform popular infrastructure tasks (for example, custom source control operations). In short, when an instance of an Enterprise Template is created, you can do almost anything you wish. And as will become evident as you read this booklet, there are times when you will indeed so wish.

Booklet Outline

This booklet is divided into three sections, each of which illustrates an important aspect or application of Enterprise Template technology:

The first part of this booklet, which constitutes its most lengthy portion, illustrates how to expose Enterprise Templates in Visual Studio .NET so that they can be accessed by other developers. As you will see, creating an Enterprise Template in Visual Studio .NET is similar to creating a "regular" .NET project, but with a few twists. The most difficult aspect of ET development is exposing custom templates to the Visual Studio .NET environment. Most notably, this process requires a thorough understanding of the file structure and conventions Visual Studio .NET uses to expose templates within the development environment.

The second part of this booklet examines two important tangential topics related to Enterprise Templates: special customization by means of the registry and Visual Studio .NET add-ins.

The third part of this booklet examines a topic closely intertwined with Enterprise Templates: architecture and modeling. The former is explained in relation to Microsoft Patterns and Architecture Group (PAG); the latter is illustrated using a product packaged with the Enterprise Architect version of Visual Studio .NET: Microsoft Visio®.

Software Requirements

This booklet is concerned primarily with the creation of Enterprise Templates using Visual Studio .NET. This capability is afforded only with the Enterprise Architect version of the product. You can leverage custom templates, however, with either the Enterprise Developer or Enterprise Architect versions of the product.

The third portion of this booklet—architecture and modeling—requires Microsoft Visio (which is bundled with the Enterprise Architect version of Visual Studio .NET).