您的位置:首页 > 大数据 > 人工智能

DSL简介

2007-10-25 17:13 246 查看
MSDN
MSDN HomeMSDN LibraryMSDN LearnMSDN DownloadsMSDN SupportMSDN Community

MSDN Library
Development Tools and LanguagesMobile and Embedded Development.NET DevelopmentOffice DevelopmentServers and Enterprise DevelopmentWeb DevelopmentWin32 and COM DevelopmentMSDN Library Archive

Development Tools and Languages
Visual Studio 2005Visual Studio .NETVisual Studio 2008 Beta 2XNA Game Studio ExpressVisual Studio 6.0Visual FoxProMicrosoft Robotics Studio

Visual Studio 2005
Visual StudioVisual SourceSafeVisual Studio Team SystemTechnical ArticlesVisual Studio Extensibility

Visual Studio
Introducing Visual StudioIntegrated Development Environment for Visual StudioDeciding Which Technologies and Tools To UseWindows-based Applications, Components, and Services.NET Framework Programming in Visual StudioVisual BasicVisual C#Visual C++Visual J#JScriptVisual Web DeveloperVisual Studio Tools for OfficeSmart Device DevelopmentTools and FeaturesVisual Studio SDKGlossary (.NET Framework)

Visual Studio SDK
Getting StartedVisual Studio Development Environment SDKVisual Studio Team Edition for TestersUsing the System Definition Model (SDM) SDKTeam Foundation Server SDKDomain-Specific Language ToolsReference

Domain-Specific Language Tools
Creating Domain-Specific LanguagesDomain-Specific Language Tools Reference

Creating Domain-Specific Languages
Getting Started with Domain-Specific LanguagesCreating Domain-Specific Language SolutionsUnderstanding the Generated APIWorking with Domain Models ProgrammaticallyAdding Validation to Domain-Specific Language SolutionsGenerating Artifacts Using Text TemplatesDeploying Domain-Specific Language SolutionsDomain-Specific Language CommandsDomain-Specific Language Tools Glossary

Getting Started with Domain-Specifi...
OverviewsSupported Visual Studio Editions for Domain-Specific Language ToolsHow Do ISamples

Overviews
Overview of Domain-Specific Language ToolsDomain-Specific Language Designer Terminology OverviewOverview of Domain ModelsOverview of ModelsOverview of Domain RelationshipsOverview of Domain Path SyntaxOverview of Tracking PropertiesOverview of Connection BuildersOverview of Element Merge DirectivesOverview of Derived Classes and Derived Relationships

 Overview of Domain-Specific Languag...

------------------------------MSDN路径 

 

 

DSL,直译过来就是“特定领域语言”,c++、C#是面向对象的,而DSL是面向问题域的。

 DSL可以做什么?         

用DSL,你可以定义自己的modeling language,例如你可以创建新的DSL来描述用户界面,商业进程,数据库,信息流等等,并用这种DSL来generate code

By using Domain-Specific Language Tools, you can design graphical languages and generate code and other text output from the domain-specific languages.

DSL如何generate code           

用DSL,你负责创建面向顾客的graphical designer(包含你自己的概念,就是说想法是顾客的,实现的概念定义是你的

),这些designergenerate被用来产生种种的models;你负责创建custom text templates来使用这些models。

即顾客使用(models and templates),generate source code and other files

DSL Tools包括什么?DSL是由DSL Tools产生的(Hmm,妖是由妖他吗生的

A project wizard that creates a fully configured solution. In this solution, you can define a domain model (designer + text output generator). If you run a completed solution from inside Visual Studio, a test solution opens in a separate instance of Visual Studio so that you can test the designer and the text output generator.(靠,就是说编译后的Experimental Hive

A graphical designer for defining and editing domain models.

Designer definitions in XML. The code for implementing designers is generated from these definitions so that you can define a graphical designer hosted in Visual Studio without manually writing any code.(Designer就是XML,XML就是Designer

A set of code generators, which take a domain model definition and a designer definition as input and produce code that implements both of the components as output. The code generators also validate the domain model and the designer definition, and they raise errors and warnings accordingly.

A framework for defining text output generators. These template-based generators take data (models) that use a domain model as input and generate text output that is based on the template. Parameters in the template are substituted by using the results of running a Visual C# script that is embedded in the template.

The following illustration provides a high-level overview of how you design, customize, test, and deploy a domain-specific language.


 

四个模板

To design a language, you begin by using the Domain-Specific Language Designer Wizard. For your convenience, the wizard provides the following solution templates:(耳熟能详

Task Flow Diagrams

Class Diagrams

Minimal Language

Component Diagrams

两个Projects

Running the wizard, a Visual Studio solution is created, contains the following projects:

Dsl

                           The Dsl project defines the domain-specific language and its editing and processing tools.

DslPackage

                           The DslPackage project determines how the language tools integrate with Visual Studio.

如何改变DSL

           因为solution里几乎所有的代码都是由language definition files创建, 目前就是*.flt. 因此改变这个文件,就改变了Language

           那些text templates (typically called *.tt), 是用来创建代码的。*.tt读取language definition产生code。因此一旦改变了Language definition files,你应该 transform all templates. For more information, see How to: Run Text Templates and How to: Generate Code from Text Templates.

           In many cases, you create code or other artifacts from your domain-specific language. You can build text templates in the debugging project, which read the model and generate files from it.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息