Presentation is loading. Please wait.

Presentation is loading. Please wait.

DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information.

Similar presentations


Presentation on theme: "DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information."— Presentation transcript:

1 DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information Management Group

2

3 A Microsoft Solution Provider and Authorized Technical Education Center Consulting, knowledge transfer and online learning solutions based on Microsoft technologies Founded 1987, based in Chicago, IL USA Corporate information: www.imginc.com

4 Agenda Enterprise Templates Overview Enterprise Template Features What’s new today Futures Q & A

5 IT Development Problems IT development projects are getting more complex, larger, and more critical A poor application architecture can make any platform perform poorly A good architecture only works if people follow the rules when implementing it Good help is hard to find (and expensive!) “Best Practices” are useless if no one reads them

6 Enterprise Templates Implementation - Package reusable code in easy to use ways Policy - Define active design time rules to help avoid common problems Guidance - Provide “Just-In-Time” help Help architects capture and share best practices as Application Construction Toolkits

7 Reusable Implementation Common, standard code everyone should use Active – Interactive Wizards Static – Standard ETP prototypes When components are not enough Custom code or optimization required Too many variations for “one size fits all” Default Implementation – Created on File | New | Project Optional Implementation – Added only when needed

8 An Enterprise Template Example demo demo

9 Steps to building an Enterprise Template with VS.NET 1. Create a VS.NET Class Library project 2. Add a reference to envDTE 3. Define a new Template Class a) Create a class that implements the EnvDTE.IDTWizard Interface b) Add the ‘Guid’ and ‘ProgID’ Attributes to the class 4. Implement the ‘Execute’ method 5. Register the assembly to COM 6. Create the.vsdir and.vsz files 7. Register the Template with Visual Studio.NET

10 Step 1: Create a VS.NET Class Library project

11 Step 2: Add a reference to envDTE

12 Step 3: Define a new Template Class Imports System.Runtime.InteropServices <Guid("00000000-2003-4920-A9F3-BB589069D914"), _ ProgId("AppArchWiz.Wizard2003")> _ Public Class MyCustomWizard Implements EnvDTE.IDTWizard End Class

13 Step 4: Implement the ‘Execute’ method Public Sub Execute(ByVal Application As Object, _ ByVal hwndOwner As Integer, _ ByRef ContextParams() As Object, _ ByRef CustomParams() As Object, _ ByRef retval As EnvDTE.wizardResult) _ Implements EnvDTE.IDTWizard.Execute Try SetWizardState(Application, contextParams, customParams) Dim frmAppArch As frmAppArch frmAppArch = New frmAppArch frmAppArch.clsWizard = Me frmAppArch.Text = "Application Architecture for.NET - " + ProjectName If frmAppArch.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return End If Dim soln As EnvDTE.Solution soln = CreateVSSolution(AppObject, LocalDirectory, InstallationDirectory, _ SolutionName, ProjectName, ExclusiveSolution) Catch e As Exception MsgBox("An error occured while creating the solution. The wizard is unable to continue." _ + vbCrLf + vbCrLf + e.Message + " (" + e.Source + ")", _ MsgBoxStyle.Critical, "Error") End Try End Sub

14 Step 5: Register the Assembly to COM Create a Strong Name Key Use sn.exe /k AppArchWiz.snk Set Assembly Version Attribute [assembly: AssemblyVersion("1.0.0.03")] Assign strong name file to Assembly-level attribute [assembly: AssemblyKeyFile(@“AppArchWiz.snk")] Register Assembly with COM Use ‘regasm.exe AppArchWiz.dll /codebase’

15 Step 6: Create the.vsz and.vsdir files.vsz VSWIZARD 7.0 Wizard=AppArchWiz.Wizard2003 (Modify Wizard to match ProgID attribute in code).vsdir AppArchfor.NET.vsz| |Application Architecture for.NET Wizard|1|This wizard generates an Application Architecture for.NET Solution.| |6777| |AppArch (Modify to match name of this template).ico – icon for VS.NET dialog

16 Step 7: Register the Template with Visual Studio.NET [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\NewProje ctTemplates\TemplateDirs\{00000000-2003-4a5e-A781-188CAF8085FE}] @="Application Architecture for.NET Wizard" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\NewProje ctTemplates\TemplateDirs\{00000000-2003-4a5e-A781-188CAF8085FE}\/1] "TemplatesDir"="C:\\Program Files\\Microsoft Visual Studio.NET 2003\\EnterpriseFrameworks\\ProxyProjects\\Application Architecture for.NET\\" "SortPriority"=dword:00000000 @="Application Architecture for.NET Wizard" Need to modify GUID (2 locations) – match GUID attribute in code Description – ‘@=‘ (2 locations) TemplatesDir – to location of.vsz and.vsdir files

17 Policy Design-time rules Defined in Template Description Language (TDL) XML schema “Active” guidance, not strict enforcement Benefits Help avoid common problems Provide context specific component property settings Simplify & filter inappropriate choices

18 Policy Examples demo demo

19 Policy Defining Development Policy For each design time framework component, define: Component identification Containment restrictions Reference restrictions Default property values and ranges Context and help topics

20 “Just-In-Time” Guidance User defined help topics Plain HTML or Compiled Help Local or centrally managed Custom context keywords & attributes Links appear in Dynamic Help Window Benefits IDE integrated, Framework specific help Subtle but timely reminders More up-to-date (Centralized management)

21 “Just-In-Time” Guidance Example demo demo

22 “Just-In-Time” Guidance Beyond HTML pages VS Help Integration Kit (VSHIK) Access to MS Help 2.1 SDK Integrate custom help into index and TOC Free download MSDN Download center http://msdn.microsoft.com/downloads/default.asp (Search for VSHIK)

23 Client example of an Enterprise Template Web Services – based Application Architecture Several steps needed once a developer created a Win Form VS.NET project Enterprise Template generated needed code and component references WinForm ServiceAgentFactory ServiceAgent ServiceInterfaceAuthor.dllXMLWebServiceCall

24 Client example of an Enterprise Template demo demo

25 What’s New in VS.NET 2003 Policy Editor Simplifies policy definition process Free download Full source available  “Unsupported” tool  Still requires “policy dance” Download at: http://msdn.microsoft.com/vstudio/downloads/updates/default.aspx http://msdn.microsoft.com/vstudio/downloads/updates/default.aspx

26 Policy Editor demo demo

27 Futures More powerful policy Policy on solution & any projects Improved identify (uniqueness & web) Separate policy from definitions Minimum & maximum allowed ElementSet PolicyMode support Author defined reminder text and severity Migration support Updated Policy Editor

28 Resources VS Enterprise Tools Community Microsoft.public.vsnet.enterprise.tools Microsoft.public.vsnet.enterprise.tools Architect Community http://www.gotdotnet.com/team/architectur e/Patterns/templates.aspx http://www.gotdotnet.com/team/architectur e/Patterns/templates.aspx

29 Summary Enterprise Templates Overview Enterprise Template Features What’s new today Futures

30 Community Resources http://www.microsoft.com/communities/default.mspx Most Valuable Professional (MVP) http://www.mvp.support.microsoft.com/ Newsgroups Converse online with Microsoft Newsgroups, including Worldwide http://www.microsoft.com/communities/newsgroups/default.mspx User Groups Meet and learn with your peers http://www.microsoft.com/communities/usergroups/default.mspx

31 evaluations evaluations

32 © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Download ppt "DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information."

Similar presentations


Ads by Google