随笔分类 -  DSL

Domain Specific Language
摘要:ƒ The Message-Routing DSL is an example of an imperative DSL. It’s executed to perform some goals. ƒ The Authorization DSL is a more declarative example (but still mostly impera- tive). It’s executed to produce a value, which is later used. ƒ The Quote-Generation DSL is a mostly declarative exam... 阅读全文
posted @ 2012-11-05 11:51 2012 阅读(480) 评论(0) 推荐(0) 编辑
摘要:DSL Model 对应的DSL内容 treatment of default_customer upon bad_credit: authorize_funds cart.Total, "We require full authorization of the amount in low credit rating scenarios" define preferred_customer: customer.TotalPurchaseAmount > 5000 define default_customer: customer.Total... 阅读全文
posted @ 2012-10-27 13:22 2012 阅读(348) 评论(0) 推荐(0) 编辑
摘要:基于boo这个语言实现的几个dsl例子,可以作为我们学习的参考Brail Castle Project http://www.castleproject.org/monorail/documentation/trunk/viewengines/brail/index.html. It’s a text templating language, built by me, in which in you can mix code and text freely. Here’s a sample: <h1>My name is ${name}</h1> <ul> 阅读全文
posted @ 2012-10-12 17:14 2012 阅读(625) 评论(0) 推荐(0) 编辑
摘要:keywords Boo syntax C# equivalent class Car: pass pass keyword public class Car { } employee is null ... 阅读全文
posted @ 2012-10-10 08:26 2012 阅读(826) 评论(0) 推荐(1) 编辑
摘要:Boo is an object-oriented, statically typed programming language for the Common Language Infrastructure (CLI) with a Python-inspired syntax and a special focus on language and compiler extensibility. It’s this focus on extensibility that makes it ideally suited for building DSLs. Boo is not just... 阅读全文
posted @ 2012-10-09 17:24 2012 阅读(2035) 评论(0) 推荐(0) 编辑
摘要:IDE集成 Using Visual Studio as your DSL IDE Using #develop as your DSL IDESharpDevelop(#develop) Integrating an IDE with a DSL application The main difference between creating an IDE and integrating an IDE lies in the capa- bilities that you provide the user with. In the IDE scenario, you’re prov... 阅读全文
posted @ 2012-09-24 12:44 2012 阅读(464) 评论(0) 推荐(0) 编辑
摘要:应用中集成DSL Naming conventions Ordering the execution of scripts Performance considerations when using a DSL Segregating the DSL from the application 集中集成方式的优缺点 BOO汇总和Rhino DSL infrastructure should meet: ƒ Codify common DSL idioms so you don’t have to keep rewriting them ƒ Handle cachin... 阅读全文
posted @ 2012-09-13 08:29 2012 阅读(373) 评论(0) 推荐(0) 编辑
摘要:fluent interfaces 与DSLs的区别 because you have a lot of freedomwhen you define the language for the DSL, but fluent interfaces have to work withinthe limits of a typically rigid language to work fluent interfaces的例子 newFluentTask("warn if website is down") .Every(TimeSpan.FromMinutes(3) ) .St 阅读全文
posted @ 2012-09-10 18:44 2012 阅读(2139) 评论(0) 推荐(0) 编辑
摘要:DSL概念 Martin Fowler defines a domain-specific language (DSL) as “a computer languagethat’s targeted to a particular kind of problem, rather than a general purpose language that’s aimed at any kind of software problem” Domain-specific languages aren’t a new idea by any means. DSLs have been arounds.. 阅读全文
posted @ 2012-09-02 16:56 2012 阅读(2941) 评论(0) 推荐(0) 编辑
摘要:MOPThese dynamic behaviors are governed by the metaobject protocol ( MOP) that each of these languages implements in their runtime. The metaobject protocol of a language defines the semantics of the extensibility of the language artifacts. Take a look at the accompanying callout for a gentle introdu 阅读全文
posted @ 2012-08-05 09:14 2012 阅读(744) 评论(0) 推荐(0) 编辑
摘要:概念Metaprogrammingiswritingcodethatwritescode.Metaprogrammingiswritingcodethatmanipulateslanguageconstructsatruntime.可以编写代码的代码MetaprogrammingRubyThisparticularbrandofmetaprogrammingimpliesthatyouuseaprogramtogenerateorotherwisemanipulateasecond,distinctprogram—andthenyourunthesecondprogram.Afteryouru 阅读全文
posted @ 2012-08-03 08:17 2012 阅读(521) 评论(0) 推荐(0) 编辑