asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search





Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Archive
Writers
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

HardwareCentral
Compare products, prices, and stores at Hardware Central!

The .NET Architect: Enterprise Template Policy Files
By Brian J. Korzeniowski
Rating: 4.4 out of 5
Rate this article


  • email this article to a colleague
  • suggest an article

    Summary

    This article introduces Enterprise Template Policy Files. In this article, you will learn how policy files affect the configurable elements of the Visual Studio .NET IDE. You will learn about the Template Description Language Grammar Elements used in creating policy files. You will also learn about the "DAP.tdl" Policy File.

    This series organizes around two central premises: first, this series teaches the fundamental concepts of Enterprise Templates; second, this series demonstrates how to implement Enterprise Templates using different Visual Studio .NET Project Types. This article series will primarily benefit two types of audiences: individuals curious about Enterprise Templates (with little knowledge or experience developing Enterprise Templates), and individuals familiar with the fundamental concepts of Enterprise Templates (but seeking a more application-oriented, tools-development approach to constructing Enterprise Templates).

    The .NET Architect Enterprise Template Series will demonstrate how to build Enterprise templates and Policy Files using the following Visual Studio .NET projects:

    • The Visual Studio .NET Add-In Project
    • The Visual Studio .NET Web Service Project
    • The Visual Studio .NET Windows Service Project
    • The Visual Studio .NET Web Control Project
    • Enterprise Template Editor Windows Control
    • Enterprise Template Editor Framework

    (To my loyal readers, please note my new e-mail address: VBAnswerGuy@adelphia.net. If you are interested my book on VB.NET, or C#, please write me and ask for a sample chapter when completed.)

    Requirements

    1. Visual Studio.NET Enterprise Developer, or Enterprise Architect Edition
    2. VB.NET or C#.NET Programming Knowledge
    3. Read "The .NET Architect: Enterprise Template Overview"

    Contents

    Section 1: Introduction
    Section 2: Policy File Overview
    Section 3: Policy File Validation
    Section 4: Policy File Grammar
    Section 5: The "DAP.tdl" File
    Summary
    About the Author

    Section 1: Introduction

    The .NET Enterprise Template series covers the fundamental concepts of Enterprise Template design, development, and deployment. In this article, you will learn about Enterprise Template Policy Files as they relate to Visual Studio .NET Enterprise Template Development. This article explains the role of Policy Files in large, distributed organizations that use Enterprise Templates. To create Enterprise Templates, and Enterprise Template Policy Files, you must have either the Visual Studio .NET Enterprise Developer or Visual Studio .NET Enterprise Architect Edition installed on your computer.

    Software systems are typically modeled using methodologies such as UML (the Universal Modeling Language) and ORM (Object Role Modeling). They are constructed using various development methodologies such as Extreme Programming and the Microsoft Solutions Framework Team Programming Model, which is part of the Microsoft Solutions Framework. Each approach generates a large number of software artifacts. These artifacts are typically re-used among other development initiatives within an organization. Software artifacts are categorized, classified, and archived for later use. New applications can access your repository of reusable artifacts to eliminate duplicating the functionality of your pre-existing software components.

    A common barrier to building complex distributed enterprise applications is in labeling, locating, and understanding the artifact's proper use within the contextual framework of an organization's policies, procedures, and coding standards. Microsoft created Visual Studio .NET Enterprise Templates to help make the identification, selection, and implementation of reusable software artifacts transparent to developers; to effectively integrate common boilerplate source code for common types of developed applications; and to abstract developers from the complexities and rules of their organization's software development coding standards, procedures, and best-practices. Enterprise Template Policy Files organize pre-existing software artifacts into a structure that models the type of baseline application to be built and restrict the types of artifacts that may be part of the current application. This article describes how Policy Files abstract you from the details of conforming to your company's software development best-practices and architectural guidelines. A high-level overview of the "DAP.tdl" file structure and the "Vside.tdl" file structure is also provided.

    The .NET Architect Enterprise Template Series comprises the following articles:

    • Article 1: Enterprise Template Overview
    • Article 2: Enterprise Template Policy Files <-- YOU ARE HERE
    • Article 3: Enterprise Template TDL Language
    • Article 4: Enterprise Template Dynamic Help
    • Article 5: Enterprise Template Exercise
    • Article 6: Enterprise Template Editor Add-In
    • Article 7: Enterprise Template Editor Web Service
    • Article 8: Enterprise Template Editor Windows Service
    • Article 9: Enterprise Template Editor Web Control
    • Article 10: Enterprise Template Editor Windows Control
    • Article 11: Enterprise Template Editor Framework
    • Article 12: Enterprise Template Developer Notes

    Section 2: Policy File Overview

    Enterprise Template Policy Files have a ".tdl" extension. Policy Files are designed, customized, and associated with an Enterprise Template Project file (".etp" file). When users create a project based upon an Enterprise Template, its associated policy file is parsed and loaded into memory; the individual Enterprise Template Projects, and Enterprise Template Language Projects, are loaded into a Visual Studio .NET Solution; finally, the customizable items of the Visual Studio .NET IDE are configured according to their corresponding policy file configuration settings.

    "Dap.tdl" and "Vside.tdl" are the two main Visual Studio .NET Enterprise Template Policy Files. Policy Files primarily affect the configurable elements of Visual Studio .NET such as the Task List, the Properties Window, the Add New Project Dialog Box, the Add New Item Dialog Box, the Toolbox, the Menus, and the Dynamic Help Window. Policy Files also affect primary IDE processes such as drag and drop and cut and paste. When an Enterprise Template is opened, the associated Policy File is parsed and applied to the Visual Studio .NET IDE, resulting in a development environment custom configured for the chosen development task.

    Policy Files use Template Services to communicate configuration information to various Visual Studio .NET IDE elements. These elements include the Task List, Toolbar, Property Browser, Project Explorer, Dynamic Help Window, and any Designers or Editors. To configure an IDE element, Template Services send configuration messages to the target IDE element. To configure the Task List, the Policy File sends "Policy Reminder" messages to the .NET IDE. To configure the Toolbox, the Policy File sends "Control Constraint" messages to the .NET IDE. To configure the Property Browser, the Policy File sends "Property Constraint" messages to the .NET IDE. To configure the Project Explorer, the Policy File sends "Project Structure" messages to the .NET IDE. To configure the Dynamic Help Window, the Policy File sends "Selection Context" messages to the .NET IDE. Finally, to configure the Visual Studio .NET Designers and Editors, the Policy File sends "Launch & Configure" messages to the IDE. Figure 1.0 illustrates the relationships just mentioned.

    IDE Object

    Message

    Task List

    Policy Reminders

    Toolbox

    Control Constraints

    Property Browser

    Property Constraints

    Project Explorer

    Project Structure

    Dynamic Help Window

    Selection Context

    Designers & Editors

    Launch & Configure

     

     


    (figure 1.0)

    Section 3: Policy File Validation

    An Enterprise Template Project agrees to be bound by its associated policy file constraints. The process of determining if an Enterprise Template follows the directives of its Policy File is called Policy File Validation. Validation is initiated when projects, folders, and other items are added, deleted, or rearranged within the current project hierarchy.

    The policy file validation process begins when a change occurs to the active solution in the Visual Studio .NET Solution Explorer. Each solution item in the Solution Explorer is mapped to a specific tag in the project's policy file. When an item is modified in the Solution Explorer, the item's associated tag is consulted to determine if the attempted modification is allowable and if the modification conforms to the restrictions listed in the policy file. If the change is an allowable modification, the change is applied to the solution item or the modification is made. If the change is a forbidden modification, the change is not applied to the solution item and the modification is not made.

    A policy file validation error occurs when policy file syntax is incorrect. A policy file conflict error occurs when an attempted modification of a solution item is rejected. Policy File Validation Errors and Conflict Errors are processed differently. When a policy file validation error occurs, two solutions exist to fix the error: you can correct the offending policy file setting or you can modify the solution item that triggered the validation error. When a policy file conflict error occurs, there is typically more than one <ELEMENT> node defining the same value for the same property or feature. When conflict errors occur, the rejected solution item's policy is not applied and the conflict error is listed in the Task List. Pay careful attention to designing your Enterprise Templates and associated Policy Files - this will help decrease the amount of conflicting errors when enforcing policy file constraints against specific solution projects and items.

    Section 4: Policy File Grammar

    Enterprise Template Policy Files are constructed using an XML Grammar that defines the projects, items and constraints that encompass the policy definition. Figure 2.0 represents the available grammar elements for constructing Enterprise Templates and Policy Files. The collection of grammar elements used to define Enterprise Templates is collectively referred to as the Template Definition Language (TDL). You will learn more about the Enterprise Template Definition Language Grammar Elements (TDL) in article three titled, "Enterprise Template TDL Language."

    Template Definition Language (TDL) Grammar Elements

     

     

     

    ·          <CATEGORIES>

    ·          <FEATURES>

    ·          <PROPERTYCONSTRAINT>

    ·          <CATEGORY>

    ·          <GUID>

    ·          <PROPERTYCONSTRAINTS>

    ·          <CATEGORYMEMBER>

    ·          <ID>

    ·          <PROTOTYPE>

    ·          <CMDID>

    ·          <IDENTIFIER>

    ·          <PROTOTYPES>

    ·          <CONSTRAINTS>

    ·          <IDENTIFIERDATA>

    ·          <READONLY>

    ·          <CONTEXT>

    ·          <IDENTIFIERS>

    ·          <TDL>

    ·          <CTXTATTRIBUTE>

    ·          <INCLUDE>

    ·          <TOOLBOXCONSTRAINT>

    ·          <DEFAULT>

    ·          <MAXVALUE>

    ·          <TOOLBOXCONSTRAINTS>

    ·          <DEFAULTACTION>

    ·          <MEMBERCONSTRAINT>

    ·          <TOOLBOXITEM>

    ·          <DEFAULTSETTINGS>

    ·          <MEMBERCONSTRAINTS>

    ·          <TOOLBOXITEMS>

    ·          <DESCRIPTOR>

    ·          <MENULINK>

    ·          <TOOLBOXLINK>

    ·          <ELEMENT>

    ·          <MENULINKS>

    ·          <TOOLBOXLINKS>

    ·          <ELEMENTS>

    ·          <MENUS>

    ·          <TYPE>

    ·          <ELEMENTSET>

    ·          <MINVALUE>

    ·          <VALUE>

    ·          <ENABLED>

    ·          <NAME>

     

    ·          <EXCLUDE>

    ·          <ORDER>

     

    ·          <FEATURELINKS>

    ·          <POLICYMODE>

     

     

     

     


    (figure 2.0)

    Section 5: The

     

    1  :   <TDL>
    2  :     <DEFAULTSETTINGS>
    3  :          <DEFAULTACTION>
    4  :          <ORDER>
    5  :          <POLICYMODE>
    6  :          <CONSTRAINTS>
    7  :               <PROPERTYCONSTRAINTS>
    8  :               <MENUCONSTRAINTS>
    9  :               <TOOLBOXCONSTRAINTS>
    10:     <ELEMENTS>
    11:          <ELEMENT>
    12:               <ID>
    13:               <CONTEXT>
    14:                    <CTXTKEYWORD>
    15:                    <CTXTATTRIBUTE>
    16:                         <NAME>
    17:                         <VALUE>
    18:               <IDENTIFIERS>
    19:                    <IDENTIFIER>
    20:                         <TYPE>
    21:                         <IDENTIFIERDATA>
    22:                              <NAME>
    23:                              <VALUE>
    24:               <FEATURELINKS>
    25:                    <MENULINKS>
    26: