DSL简介

本文介绍了如何使用Visual Studio中的特定领域语言(DSL)工具来定义和定制图形语言,以及如何从这些语言生成代码和其他文本输出。通过DSL工具,可以轻松地创建面向特定领域的图形设计器和文本模板。
 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.

DSL overview process 

  • 四个模板

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.

标题基于Python的自主学习系统后端设计与实现AI更换标题第1章引言介绍自主学习系统的研究背景、意义、现状以及本文的研究方法和创新点。1.1研究背景与意义阐述自主学习系统在教育技术领域的重要性和应用价值。1.2国内外研究现状分析国内外在自主学习系统后端技术方面的研究进展。1.3研究方法与创新点概述本文采用Python技术栈的设计方法和系统创新点。第2章相关理论与技术总结自主学习系统后端开发的相关理论和技术基础。2.1自主学习系统理论阐述自主学习系统的定义、特征和理论基础。2.2Python后端技术栈介绍DjangoFlask等Python后端框架及其适用场景。2.3数据库技术讨论关系型和非关系型数据库在系统中的应用方案。第3章系统设计与实现详细介绍自主学习系统后端的设计方案和实现过程。3.1系统架构设计提出基于微服务的系统架构设计方案。3.2核心模块设计详细说明用户管理、学习资源管理、进度跟踪等核心模块设计。3.3关键技术实现阐述个性化推荐算法、学习行为分析等关键技术的实现。第4章系统测试与评估对系统进行功能测试和性能评估。4.1测试环境与方法介绍测试环境配置和采用的测试方法。4.2功能测试结果展示各功能模块的测试结果和问题修复情况。4.3性能评估分析分析系统在高并发等场景下的性能表现。第5章结论与展望总结研究成果并提出未来改进方向。5.1研究结论概括系统设计的主要成果和技术创新。5.2未来展望指出系统局限性并提出后续优化方向。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值