.gif)
patterns & practices Developer Center August 2006
The Smart Client Software Factory includes a guidance package named Smart Client Development. A guidance package consists of named collections of recipes, templates, value providers, type editors, type converters, and actions. Developers can use a guidance package to perform a series of development activities in Visual Studio 2005, activities that developers usually have to manually perform. For example, developers can use the Smart Client Development Package to create an initial solution structure that includes classes for the root work item and module, and that has the required references to the Composite UI Application Block assemblies. This document provides an overview of the Guidance Automation Toolkit. To learn about the contents of the Smart Client Development guidance package, and how to build, install, and enable it, see Smart Client Development Guidance Package.
Overview
Architects use the Guidance Automation Toolkit to create a guidance package. After it is created, the architect distributes a Microsoft Windows Installer that contains the package. Developers install the package on development computers that have the required run-time component Guidance Automation Extensions. After a guidance package is installed and enabled for a particular solution, the developer executes recipes to perform the required tasks. These tasks affect the structure and source code of the active solution. For example, a particular task may add a project to the solution and create three classes in that project. The developer adds customizations and additional business logic to the solution. During development, the developer can use the package to perform other tasks. The developer builds the application and distributes it to the end users. Figure 1 illustrates how a guidance package is created and used across the development life cycle.
.png)
Figure 1. Guidance life cycle
Key Concepts
A guidance package extends Visual Studio and offers guidance to developers as they develop applications. Developers activate the guidance through gestures in Visual Studio. For example, a developer can right-click a class in Solution Explorer and then click a guidance package menu item. When the developer clicks the menu item, the package executes a series of tasks. The results of the task can be simple, such as the addition of method to the class, or complex, such as the creation of new project with classes that are added to the solution.
A guidance package often includes Visual Studio templates. When a developer installs a guidance package that includes a Visual Studio template, the template will appear in the New Project dialog box of Visual Studio. Each guidance package that includes a Visual Studio template appears under the project type category named Guidance Packages. Figure 2 illustrates a development computer that has two guidance packages that contain at least one Visual Studio template: Smart Client Development and Guidance Package Development. The Smart Client Development guidance package contains a single Visual Studio template named Smart Client Application.
.png)
Figure 2. Guidance packages with solution templates in the Visual Studio New Project dialog box
Guidance packages also include recipes. Recipes define a series of actions that a developer typically manually performs in Visual Studio. The actions are activities that create or transform solution artifacts. A developer can use a recipe to automate these actions. Recipes appear in the Visual Studio interface as commands. Recipes can be run on particular solution elements or on a group of solution elements that share certain characteristics (for example, all C# projects). Figure 3 illustrates the View recipe as it appears on the Add menu of the Shell project.
.png)
Figure 3. The View (with presenter) recipe menu item
Actions create or update solution artifacts; they do this by expanding a Visual Studio template or a T4 template. Figure 4 illustrates the relationship between a guidance package and the key components it contains.
.png)
Figure 4. Key components of a guidance package
Guidance Package Manager
Using the Guidance Package Manager, developers perform a variety of operations on guidance packages, recipes, and Visual Studio templates.
To view the Guidance Package Manager
- Using Visual Studio, open your solution.
- On the Tools menu, click Guidance Package Manager. Figure 5 illustrates the Guidance Package Manager in a solution that uses the Smart Client Development Package.
.png)
Figure 5. Guidance Package Manager
The following user operations are supported from the Guidance Package Manager:
- Viewing installed guidance packages. Information about installed guidance packages is stored in the framework manifest file. The Guidance Package Manager inspects the file and shows the user the available guidance packages.
- Inspecting content of a guidance package. When asked to inspect a guidance package, the Guidance Package Manager reads the configuration file of the guidance package and inspects the guidance package directory. Based on this information, the Guidance Package Manager shows the user a list of guidance package recipes and templates. The user can inspect both enabled and disabled guidance packages.
- Enabling a guidance package. After a guidance package is installed, it must be enabled before its recipes and templates can be used inside a Visual Studio solution. The developer can enable a package from the Guidance Package Manager.
- Disabling a guidance package. This is the opposite of enabling a guidance package. Disabling a guidance package does not uninstall it.
- Viewing solution recipes and templates. The Guidance Package Manager communicates with the Recipe Framework foundation and shows all recipe and template references currently associated with the solution.
- Executing a recipe. The developer can select a recipe reference and execute its recipe directly from the Guidance Package Manager. Templates cannot be executed from the Guidance Package Manager; they have to be executed from the Add New Project dialog box or the Add New Item dialog box.
- Deleting a recipe reference. The developer can delete a recipe reference by selecting it and clicking delete.
Installing and Enabling a Guidance Package
Before a guidance package can be used in a solution, it must be installed and enabled. You install a guidance package by executing a Windows Installer package.
Note If you want to install a guidance package on the same computer that was used to create the guidance package, you must first unregister the guidance package before you install it. To do this, use the Unregister Guidance Package recipe (available in the Guidance Package Manager when you have the Guidance Automation Toolkit installed).
After you install a guidance package, you must enable it before you can use its recipes and templates inside a Visual Studio solution. A package can be enabled in one of two ways:
- Unfolding a Visual Studio solution template that contains actions that enable the package
- Selecting and enabling the guidance package in Guidance Package Manager
.gif)