1 / 20

Guidance Automation Toolkit

Guidance Automation Toolkit. VISUG 09/08/2006 Jelle Druyts http://jelle.druyts.net. Agenda. Introduction Wizards (Recipes) More than just wizards Continuous Guidance. Guidance Automation Toolkit. Introduction. A 40-page document full of guidelines Architectural layers

nubia
Download Presentation

Guidance Automation Toolkit

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Guidance Automation Toolkit VISUG 09/08/2006 Jelle Druyts http://jelle.druyts.net

  2. Agenda • Introduction • Wizards (Recipes) • More than just wizards • Continuous Guidance

  3. Guidance Automation Toolkit Introduction

  4. A 40-page document full of guidelines • Architectural layers • Solution/project structure • Namespaces, class names, method names, ... • Best practices • Step-by-step instructions Visual Studio customizations • Custom actions • Custom “Add New” items (classes, projects) Code generation Empty quick-start solutions for development teams Home > Introduction Have you ever needed...

  5. Visual Studio has an object model • Call the Visual Studio API’s directly • EnvDTE.dll and EnvDTE80.dll Powerful • Entire Visual Studio object model is exposed Difficult • Registering custom packages in Visual Studio • COM interop with EnvDTE object model Home > Introduction Visual Studio SDK

  6. Guidance Automation • Making reusable code and pattern assets directly available in Visual Studio 2005 • Integrating reusable code into applications • Guiding developers through complex procedures Uses Visual Studio SDK behind the scenes Built and used by Microsoft Patterns & Practices • Web Service Software Factory • Smart Client Software Factory • Mobile Client Software Factory Latest release: June 2006 CTP Home > Introduction Guidance Automation Toolkit

  7. Home > Introduction GAX & GAT

  8. Guidance Automation Toolkit Wizards (Recipes)

  9. A Guidance Package consists of • Visual Studio Templates • Provide integration with Visual Studio • “Create New Project/Item” dialog box • Create Solutions, Projects, Project Items, ... • Defined in .vstemplate files • Guidance Automation Recipes • Automated activities that define a series of instructions • Abstract an action that the developer would need to do manually • E.g. create projects, add references, ... • Defined in an xml file Link between both: Templates refer to Recipes Home > Wizards (Recipes) Guidance Automation Packages

  10. Home > Wizards (Recipes) Visual Studio Templates <VSTemplate Version="2.0" Type="ProjectGroup" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005"> <TemplateData> <Name>Application Block</Name> <Description>Guidance Package that creates a new Application Block.</Description> <ProjectType>CSharp</ProjectType> <Icon>ApplicationBlock.ico</Icon> </TemplateData> <TemplateContent> <ProjectCollection> <ProjectTemplateLink ProjectName="$ApplicationBlockNamespace$.$ApplicationBlockName$"> Projects\Runtime\Runtime.vstemplate</ProjectTemplateLink> </ProjectCollection> </TemplateContent> <WizardExtension> <Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=1.0.51206.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly> <FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate </FullClassName> </WizardExtension> <WizardData> <Template xmlns="http://schemas.microsoft.com/pag/gax-template" SchemaVersion="1.0" Recipe="CreateApplicationBlock"> </Template> </WizardData> </VSTemplate>

  11. Home > Wizards (Recipes) Guidance Automation Recipes <GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core" Name="JelleDruyts.EnterpriseLibraryGuidance" Caption="Enterprise Library Guidance" Description="Provides guidance around the creation of Application Blocks" Guid="2cac5b9c-a04f-4a49-8a56-3ee5d63bd83f" SchemaVersion="1.0"> <Recipes> <Recipe Name="CreateApplicationBlock"> <Caption>Create a new Enterprise Library Application Block</Caption> <Arguments> <Argument Name="ApplicationBlockName" Required="true"> <ConverterType="Microsoft.Practices.RecipeFramework.Library.Converters. CodeIdentifierStringConverter, Microsoft.Practices.RecipeFramework.Library" /> </Argument> <Argument Name="ApplicationBlockNamespace" Required="true"> <Converter Type="Microsoft.Practices.RecipeFramework.Library.Converters. NamespaceStringConverter,Microsoft.Practices.RecipeFramework.Library" /> </Argument> </Arguments> <GatheringServiceData> <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0"> <Pages> <Page> <Title>Application Block Information</Title> <Fields> <Field ValueName="ApplicationBlockName" Label="Application Block Name" InvalidValueMessage="Must be a valid .NET identifier." /> <Field ValueName="ApplicationBlockNamespace" Label="Namespace" InvalidValueMessage="Must be a valid .NET namespace identifier." /> </Fields> </Page> </Pages> </Wizard> </GatheringServiceData> </Recipe> </Recipes> </GuidancePackage>

  12. Home > Wizards (Recipes) Guidance Package Wizard

  13. Guidance Automation Toolkit More than just wizards...

  14. Executed after a recipe is unfolded • E.g. add project references, generate classes, ... Regular .NET classes (pre-built & custom) Strongly-typed input and output arguments • Come from the recipe or another action Typically use EnvDTE Home > More than just wizards Actions <Actions> <Action Name="GetRuntimeProject" Type="...RecipeFramework.Library.Actions.GetProjectAction"> <Input Name="ProjectName" RecipeArgument="RuntimeProjectName" /> <Output Name="Project" /> </Action> <Action Name="GetDesignTimeProject" Type="...RecipeFramework.Library.Actions.GetProjectAction“> <Input Name="ProjectName" RecipeArgument="DesignTimeProjectName" /> <Output Name="Project" /> </Action> <Action Name="AddProjectReference" Type="...Library.Solution.Actions.AddProjectReferenceAction"> <Input Name="ReferringProject" ActionOutput="GetDesignTimeProject.Project" /> <Input Name="ReferencedProject" ActionOutput="GetRuntimeProject.Project" /> </Action> </Actions>

  15. Provide values for recipe arguments, optionally dependant of other recipe arguments • Define project names, post-build commands, ... • Retrieve currently selected project, file, ... Regular .NET classes (pre-built & custom) Home > More than just wizards Value Providers <Argument Name="RuntimeProjectName"> <ValueProvider Type="Evaluator" Expression="$(ApplicationBlockNamespace).$(ApplicationBlockName)"> <MonitorArgument Name="ApplicationBlockNamespace" /> <MonitorArgument Name="ApplicationBlockName" /> </ValueProvider> </Argument>

  16. T4 templates (text templates transformation toolkit) • E.g. generate data access component from database, ... ASP.NET-like syntax with full capabilities of .NET Home > More than just wizards Code Generation <#@ template language="C#" #> <#@ assembly name="System.dll" #> <#@ property processor="PropertyProcessor" name="TargetNamespace" #> <#@ property processor="PropertyProcessor" name="NodeName" #> using System; using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; using Microsoft.Practices.EnterpriseLibrary.Configuration.Design; namespace <#= this.TargetNamespace #> { internal sealed class <#= this.NodeName #> : ConfigurationNode { } }

  17. Guidance Automation Toolkit Continuous Guidance

  18. The show isn’t over when the initial solution has been created • Recipes associated with project items • Unbound / bound (to a specific item) / dynamic • E.g. right-click data access project, choose “Add Data Access Component” • Adding more templates • New projects, e.g. data access project • New project items, e.g. data access component Uses same mechanisms (wizards, actions, ...) Home > Continuous Guidance Recipes stay alive

  19. Separate window listing • Overview information • All the available recipes • History of executed recipes • Links to online help, documentation, ... Home > Continuous Guidance Guidance Navigator

  20. Questions?

More Related