BrainDump
  Home arrow BrainDump arrow Page 6 - Build a Domain Specific Language with DSL ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Build a Domain Specific Language with DSL Tools concluded
By: MSDN Virtual Labs
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2006-01-26

    Table of Contents:
  • Build a Domain Specific Language with DSL Tools concluded
  • Add a New Property
  • Introduce notation for the new property
  • Build a Business Entity Model with your new Designer
  • Generate a HTML report of your Model with your new Designer
  • Generate a HTML report of your Model with your new Designer

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Build a Domain Specific Language with DSL Tools concluded - Generate a HTML report of your Model with your new Designer


    (Page 6 of 6 )

    HTML artifacts are not the only type that can be generated. In this task we will see how to generate source code artifacts as well (as you may have guessed, the source
    code for business entity designer was generated from the .dsldd and .dmd files in this manner). As an example, we will generate some simple Windows Forms-based
    classes that might be used in the UI of an application supporting the business process defined in a business entity diagram.

      1. Right-click on the BizEntityDebugging project in the Solution Explorer, and
        choose Add->Existing Item… from the context menu.
      2. Type c:\dsl\EntityForm.cstemplate into the File name: box, and press Add.
      3. Add the file c:\dsl\Program.cstemplate to the project in the same manner
      4. Click on the EntityForm.cstemplate file in the Solution Explorer.
      5. In the Properties window, enter the value TextTemplatingFileGenerator for the Custom Tool property, and press Enter.


      6. Click on the Program.cstemplate file in the Solution Explorer.
      7. In the Properties window, enter the value TextTemplatingFileGenerator for the Custom Tool property, and press Enter.
      8. Code should be generated for both templates when the Custom Tool property is set. To regenerate the code, you can click on the Transform All Templates button in the Solution Explorer toolbar (circled in red below).


      9. Set up the BizEntityDebugging solution to launch the BizEntityDebugging project. Right-click on the solution node in the Solution Explorer, and choose the Properties command.


      10. Expand the Configuration Properties node in the Property Pages dialog box, and select the Configuration node. Check the Build checkbox.


      1. Press OK on the Property Pages dialog box.
      2. Press F5 to build and run the BizEntityDebugging project. You should see two forms pop up. Note that the title of each form corresponds to an entity defined in
        the business entity diagram, and there are editable text boxes corresponding to the
        attributes defined on each entity.
      3. By now you may be running out of time for this lab, but if you still have a few extra minutes, there are a couple things you can do:

        1. Examine the .cstemplate files and the resulting generated code. Note that the template files look similar to the .ReportTemplate file we examined in Task 7, except that the text to be generated is C# code rather than HTML.
        2. Open the Entity.biz file and modify the diagram by adding more entities
          or attributes. Save the diagram and invoke Transform All Templates to
          see the effects of these changes on the generated artifacts.

    Summary

    In this lab, you explored how the Microsoft DSL Tools for Visual Studio 2005 can be used to build a visual designer with code generation. You learned more about the files that are used to define the concepts and notation for a Domain Specific Language, and the process that takes these files and generates a complete Visual Studio designer for that language. You learned some of the options for defining different aspects of the concepts and notation, and how the notation is mapped to the concepts. You ran the generated designer, and learned how to generate code and reports from the models that you created with it.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · We hope you found this article from MSDN Labs to be entertaining and informative....
       · I think this is useful work,good done!Only one thing... where can I find the file...
       · Click on the "author bio" and you will find a link that will take you to the MSDN...
       · thanks for reply, sorry i didnt find any link like "author bio" , can you give me...
     

    BRAINDUMP ARTICLES

    - Internet Explorer 8 Review
    - Nilpo`s Top Windows Add-Ons
    - Beginning Silverlight 2.0 Development using ...
    - Fixing Vista`s Troubles
    - Preparing Windows Images for Mass Deployment
    - The Trouble With Vista
    - Slipstreamed and Unattended Windows Installa...
    - Microsoft Office SharePoint Server
    - Microsoft Office SharePoint Designer
    - Microsoft Windows SharePoint Services 3.0
    - Microsoft Live Mesh Overview
    - XAML Brushes and Silverlight
    - Silverlight and XAML Basics
    - Immortal XP
    - XAML Basics





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT