<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Domain Specific Languages</title>
        <link>http://ayende.com/Blog/category/547.aspx</link>
        <description>Domain Specific Languages</description>
        <language>en-US</language>
        <copyright>Ayende Rahien</copyright>
        <managingEditor>Ayende@ayende.com</managingEditor>
        <generator>Subtext Version 2.0.0.0</generator>
        <item>
            <title>DotNetRocks on Domain Specific Languages</title>
            <link>http://ayende.com/Blog/archive/2010/03/02/dotnetrocks-on-domain-specific-languages.aspx</link>
            <description>&lt;p&gt;Last week I recorded a DNR session about &lt;a href="http://www.dotnetrocks.com/default.aspx?ShowNum=529"&gt;Domain Specific Languages&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I also talked just a bit about writing your own DSL, some challenges that I run into since &lt;a href="http://manning.com/rahien/"&gt;the book&lt;/a&gt;, the Boo language and why it is suitable for DSLs and how the entire process works. &lt;/p&gt;  &lt;p&gt;Looking forward for your comments.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11348.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2010/03/02/dotnetrocks-on-domain-specific-languages.aspx</guid>
            <pubDate>Tue, 02 Mar 2010 18:59:00 GMT</pubDate>
            <wfw:comment>http://ayende.com/Blog/comments/11348.aspx</wfw:comment>
            <comments>http://ayende.com/Blog/archive/2010/03/02/dotnetrocks-on-domain-specific-languages.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11348.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DSLs in Boo discount offer</title>
            <link>http://ayende.com/Blog/archive/2010/02/02/dsls-in-boo-discount-offer.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://manning.com/rahien/"&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px" align="right" src="http://manning.com/rahien/rahien_cover150.jpg" /&gt;&lt;/a&gt;Manning is running a special today for &lt;a href="http://manning.com/rahien/"&gt;my book&lt;/a&gt;, 50% off print &amp;amp; ebook versions.&lt;/p&gt;  &lt;p&gt;Just use the following code: boo50&lt;/p&gt;  &lt;p&gt;Note that this code is valid only for today, so hurry up!&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11308.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2010/02/02/dsls-in-boo-discount-offer.aspx</guid>
            <pubDate>Tue, 02 Feb 2010 18:04:00 GMT</pubDate>
            <wfw:comment>http://ayende.com/Blog/comments/11308.aspx</wfw:comment>
            <comments>http://ayende.com/Blog/archive/2010/02/02/dsls-in-boo-discount-offer.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11308.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DSLs in Boo is out!</title>
            <link>http://ayende.com/Blog/archive/2010/01/23/dsls-in-boo-is-out.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://manning.com/rahien"&gt;&lt;img style="margin: 0px; display: inline" alt="7i3h.jpg" align="right" src="http://img49.yfrog.com/img49/9875/7i3h.jpg" width="180" height="240" /&gt;&lt;/a&gt;It has been quite a journey for me, &lt;a href="http://ayende.com/Blog/archive/2007/10/12/Book-Idea-Writing-Domain-Specific-Languages-in-Boo.aspx"&gt;starting in 2007(!)&lt;/a&gt; up until about a month ago, when the final revision is out. I am &lt;em&gt;very&lt;/em&gt; happy to announce that &lt;a href="http://manning.com/rahien"&gt;my book&lt;/a&gt; is now available in its final form.  &lt;/p&gt;  &lt;p&gt;When I actually got the book in my hands I was ecstatic. That represent about two years worth of work, and some pretty tough hurdles to cross (think about the challenge that editing something the size of a book from &lt;em&gt;my&lt;/em&gt; English is). And getting the content right was even harder. &lt;/p&gt;  &lt;p&gt;On the one hand, I wanted to write something that is &lt;em&gt;actionable&lt;/em&gt;, my success criteria for the book is that after reading it, you can go ahead and write production worthy Domain Specific Languages implementations. On the other hand, I didn’t want to have the reader left without the theoretical foundation that is required to understand what is actually going on. &lt;/p&gt;  &lt;p&gt;Looking back at this, I think that I managed to get that done well enough. The total page count is ~350 pages, and without the index &amp;amp; appendixes, it is just about 300 pages. Which, I hope, is big enough to give you working knowledge without bogging you down with too much theory.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11291.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2010/01/23/dsls-in-boo-is-out.aspx</guid>
            <pubDate>Sat, 23 Jan 2010 10:00:00 GMT</pubDate>
            <wfw:comment>http://ayende.com/Blog/comments/11291.aspx</wfw:comment>
            <comments>http://ayende.com/Blog/archive/2010/01/23/dsls-in-boo-is-out.aspx#feedback</comments>
            <slash:comments>21</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11291.aspx</wfw:commentRss>
        </item>
        <item>
            <title>My book is on Manning &amp;ndash; deal of the day</title>
            <link>http://ayende.com/Blog/archive/2009/12/15/my-book-is-on-manning-ndash-deal-of-the-day.aspx</link>
            <description>&lt;p&gt;My &lt;a href="http://archive.constantcontact.com/fs043/1101335703814/archive/1102858977249.html"&gt;book is on Manning’s Deal of the Day&lt;/a&gt;. DSLs in Boo: Domain Specific Languages in .NET – get the ebook for $10  by using &lt;a href="http://archive.constantcontact.com/fs043/1101335703814/archive/1102858977249.html"&gt;this link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The journey for the book is done, so it is the full deal and the final version that you’ll be getting.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/11244.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/12/15/my-book-is-on-manning-ndash-deal-of-the-day.aspx</guid>
            <pubDate>Tue, 15 Dec 2009 06:45:00 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/12/15/my-book-is-on-manning-ndash-deal-of-the-day.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/11244.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Help needed: Writing Domain Specific Languages in Boo &amp;ndash; Java Edition</title>
            <link>http://ayende.com/Blog/archive/2009/04/23/help-needed-writing-domain-specific-languages-in-boo-ndash-java.aspx</link>
            <description>&lt;p&gt;Just came out of a discussion with Manning about my book (which is approach the last few stages before actually printing!), apparently they hit upon the notion that Boo works on both the CLR and the JVM, and are interested in having a Java edition of the book.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Disclaimer: This is early, and anything is subject to change, blah blah blah.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I find this hilarious, since this is Hibernate in Action vs. NHibernate in Action, in reverse. At least, I hope it is. The problem? I am not familiar enough with Java to be able to write a book targeting it, hence this post.&lt;/p&gt;  &lt;p&gt;If you are familiar with Java and BooJay (filter 90%), read my book (filter 90%) and think you could help (filter 0%), I would love to talk to you.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10892.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/04/23/help-needed-writing-domain-specific-languages-in-boo-ndash-java.aspx</guid>
            <pubDate>Thu, 23 Apr 2009 16:10:49 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/04/23/help-needed-writing-domain-specific-languages-in-boo-ndash-java.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10892.aspx</wfw:commentRss>
        </item>
        <item>
            <title>M is to DSL as Drag &amp;amp; Drop is to programming</title>
            <link>http://ayende.com/Blog/archive/2009/03/23/m-is-to-dsl-as-drag-amp-drop-is-to.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 40px 0px 0px; border-left: 0px; border-bottom: 0px" height="170" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_thumb.png" width="170" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I have been sitting on this post for a while now, because that was my first impression after seeing Oslo &amp;amp; M and all the hype around it from the PDC. To be frank, I had a hard time believing my own gut feeling. I kept having the feeling that I am missing something, which is why I avoided talking about this so far.&lt;/p&gt;  &lt;p&gt;But, as time passed, and as we started to see more and more about Oslo and M, it validated my initial thinking. Now, just to be clear, I don’t intend to even touch on the whole of Oslo in this post. I don’t have a problem stating that I still don’t see the whole point there, but that is beside the point (no pun intended). What I would like to talk about is the M language, its usage, and the DSL that Microsoft shows as samples.&lt;/p&gt;  &lt;p&gt;I see M as a whole lot of effort trying to optimize something that is really not that interesting, complex or really very hard. I look at the M language, the way that you worked with, the tooling and the API and I would fully agree that it is a nice parser generator. &lt;/p&gt;  &lt;p&gt;What it is &lt;em&gt;not&lt;/em&gt;, I have to say, is a DSL toolkit. It is just one, small, part of building a DSL. And, to be perfectly honest, M is the drag &amp;amp; drop of DSL. It &lt;em&gt;looks&lt;/em&gt; good, on first glance, but then you dig just a little deeper and you see what actually going on, and you realize that you are probably not where you wanted to be.I  see it as trying very hard to optimize opening the car’s door. While I assume that this is interesting to &lt;em&gt;someone&lt;/em&gt; in the world, optimizing the opening of a car door is crucial, I don’t really see it as an important feature. More to the point, it has negligible effect on the time taken for the primary task for which we use a car, the actual driving!&lt;/p&gt;  &lt;p&gt;Why am I saying that?&lt;/p&gt;  &lt;p&gt;Well, M is used for defining the syntax of the language, which is what most people look at. It does a good job there, but it also &lt;em&gt;stops &lt;/em&gt;there. And there is a lot of stuff other then the syntax that you really care about.&lt;/p&gt;  &lt;p&gt;Here is a snippet from &lt;a href="http://www.claudioperrone.com/blog/articles/2008/11/09/misbehave-01-oslos-mgrammar-for-bdd-executable-specifications/"&gt;MisBehave&lt;/a&gt;, which was an attempt to build a BDD framework on top of M:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="70" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_thumb_1.png" width="303" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Pretty impressive syntax, right? &lt;/p&gt;  &lt;p&gt;The problem is that there isn’t really a good way to take this and translate that into something that is &lt;em&gt;executable&lt;/em&gt;. Not without doing a &lt;em&gt;lot&lt;/em&gt; of work. And that is why I am saying that M isn’t really an important piece of the stack. The actual syntax definition isn’t really that important. It is all the other things that you do with the DSL that matters. &lt;/p&gt;  &lt;p&gt;Let us take a look at &lt;a href="http://www.douglaspurdy.com/2009/03/20/murl-a-dsl-for-restful-clients/"&gt;MUrl&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="533" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/MistoDSLasDragDropistoprogramming_C9D9/image_thumb_2.png" width="711" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I am looking at this, and after looking at the source code, I still can’t figure out the point.&lt;/p&gt;  &lt;p&gt;Yes, this is a demo DSL. But it is a good example that shows how you can completely miss the point with regards to a DSL. What problem does this DSL solve? What benefits do I get from integrating that into my system?&lt;/p&gt;  &lt;p&gt;&lt;em&gt;How does this helps me solve a real problem?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The answer is that it doesn’t. The only remotely useful case that I can think of is if I really want to be able to issue REST calls from the command line, and even then, there are better ways of doing that on the command line. MUrl is an exercise in abstraction for the sake of abstraction. More than that, it gives the impression that it is something that is is not.&lt;/p&gt;  &lt;p&gt;If you want to show me a DSL, show me one that has logic, not one that is a glorified serialization format. That is the sweet spot for a DSL, to extract policy decisions from your systems, so you can work with them at a higher level and have easier time making change.&lt;/p&gt;  &lt;p&gt;M is not a language for creating DSL. It is a language to define a serialization format, that is all.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10834.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/03/23/m-is-to-dsl-as-drag-amp-drop-is-to.aspx</guid>
            <pubDate>Mon, 23 Mar 2009 12:21:22 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/03/23/m-is-to-dsl-as-drag-amp-drop-is-to.aspx#feedback</comments>
            <slash:comments>22</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10834.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Building Domain Specific Languages with Boo &amp;ndash; Full book now available</title>
            <link>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://www.manning.com/affiliate/idevaffiliate.php?id=854_111"&gt;&lt;img alt="Building DSL with Boo Cover" src="http://www.ayende.com/images/rahien_cover150.jpg" border="0" /&gt;      &lt;br /&gt;Building Domain Specific Languages with Boo&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another big milestone, early access subscribers can now read the entire book, all 13 chapters and both appendixes.&lt;/p&gt;  &lt;p&gt;Not edited yet, but much closer to completion.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10803.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx</guid>
            <pubDate>Mon, 02 Mar 2009 00:22:20 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/03/02/building-domain-specific-languages-with-boo-ndash-full-book-now.aspx#feedback</comments>
            <slash:comments>11</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10803.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DSL: Tests as documentation</title>
            <link>http://ayende.com/Blog/archive/2009/02/09/dsl-tests-as-documentation.aspx</link>
            <description>&lt;p&gt;I have several DSL that have no documentation beyond their source and the tests. They are usable, useful and have been of a lot of help. However, I have run into situations where I, as the language author, could not answer a question about the language without referring to the code. I strongly recommend in investing the time to create good documentation in your DSL. &lt;/p&gt;&lt;p&gt;Even if you are using a Behavior Driven Design flavored tests, it is not quite enough. Those types of tests can help make it clear what the language is doing, but they are not the type of documentation that you can hand to an end user and expect them to start using the language. &lt;/p&gt;&lt;p&gt;Even if your users are developers, it is not nearly good enough approach. It is your responsibility to make the system easy to use for the users, and documentation is a key part of that. &lt;/p&gt;&lt;p&gt;Handing them the tests is a good way to handle the complex cases, if your users are developers, but it is not a good way to reduce the learning curve.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10770.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/02/09/dsl-tests-as-documentation.aspx</guid>
            <pubDate>Mon, 09 Feb 2009 10:48:11 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/02/09/dsl-tests-as-documentation.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10770.aspx</wfw:commentRss>
        </item>
        <item>
            <title>I need some advice about the book</title>
            <link>http://ayende.com/Blog/archive/2009/01/14/i-need-some-advice-about-the-book.aspx</link>
            <description>&lt;p&gt;I have got the final reviews about the book (Building Domain Specific Languages with Boo), and a few of them talk about a problem in the book that I am not sure how to solve.&lt;/p&gt;  &lt;p&gt;The problem is, quite simply, the book talks about Boo a lot. I see the book not as a academic topic, but as something that would give the reader actionable knowledge. At the same time, I try to cover the entire life cycle of a DSL. So the book covers things like how to design a good syntax, documenting DSLs, how to structure them, versioning issues and other aspects that are mostly agnostic to the actual tool that we use to build the DSL.&lt;/p&gt;  &lt;p&gt;On the other hand, things like integrating with a unit testing framework, or building UI, or the exact particulars about how to build certain aspects of the DSL and common recipes for frequent problems are strongly tied to the actual technology that we are using. Oh, we can probably discuss some of them in abstract, but I don’t think it would be nearly as valuable.&lt;/p&gt;  &lt;p&gt;One of the goals that I have when writing this book is to create an actionable document, one that you can use to start working on a DSL right away. There are several DSLs out there that I can directly trace to the book (Simple State Machine and Horn), so I think that I did a good job there.&lt;/p&gt;  &lt;p&gt;The problem, as reflected in the reviews, that people expected to see much more about DSLs and maybe get some brief discussion about the actual implementation in Boo.&lt;/p&gt;  &lt;p&gt;I think that the main issue is different expectations that they had, and I am wondering what we can do about it. One of the options that we consider is to rename the book to reflect what it actually contain better. However, I don’t know what name would suit it better, and I don’t even know if that is the best solutions.&lt;/p&gt;  &lt;p&gt;Can you offer some suggestions?&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10717.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2009/01/14/i-need-some-advice-about-the-book.aspx</guid>
            <pubDate>Wed, 14 Jan 2009 17:15:23 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2009/01/14/i-need-some-advice-about-the-book.aspx#feedback</comments>
            <slash:comments>23</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10717.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Should you be able to define new abstractions in a Domain Specific Language?</title>
            <link>http://ayende.com/Blog/archive/2008/12/23/should-you-be-able-to-define-new-abstractions-in-a.aspx</link>
            <description>&lt;p&gt;Fowler has a &lt;a href="http://martinfowler.com/bliki/DslExceptionalism.html"&gt;post about DSL&lt;/a&gt;, which contain the following:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The first is in language design. I was talking with a language designer who I have a lot of respect for, and he stressed that a key feature of languages was the ability to define new abstractions. With DSLs I don't think this is the case. In most DSLs the DSL chooses the abstraction you work with, if you want different abstractions you use a different DSL (or maybe extend the DSL you're using). Sometimes there's a role for new abstractions, but those cases are the minority and when they do happen the abstractions are limited. Indeed I think the lack of ability to define new abstractions is one of the things that distinguishes DSLs from general purpose languages.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;I disagree with the statement that this is an exception. This is something that come up again and again in a DSL. You start with a given concept of what you want to do, and you give it to the users. Rinse &amp;amp; repeat a couple of time and you have a language that the users can start play with.&lt;/p&gt; &lt;p&gt;The main problem is that not giving the users that facilities for abstraction usually mean that they will work around your system, or that the DSL scripts that you will have will suffer from copy &amp;amp; paste, unnecessary complexity, etc.&lt;/p&gt; &lt;p&gt;A trivial example would be how to define customer roles. You want to be able to process orders based on customer role, and as such, it is important to be able to define how you choose a customer. Not only that, but even the customer selection criteria should be abstracted.&lt;/p&gt; &lt;p&gt;Here are a few examples:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Bad customer:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Bad credit rating&lt;/li&gt; &lt;li&gt;OR More than 5 returns last year&lt;/li&gt; &lt;li&gt;OR More than 5 helpdesk calls last 6 months&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Silver Customer&lt;/li&gt; &lt;ul&gt; &lt;li&gt;More than 5 purchases&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Gold Customer&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Total purchases over 5,000$&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;Preferred customer:&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Not a bad customer&lt;/li&gt; &lt;li&gt;Gold customer&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;We want to define roles using other roles. Because that is how the &lt;em&gt;business&lt;/em&gt; thinks about it. We naturally create abstractions for ourselves, because this is how we think.&lt;/p&gt; &lt;p&gt;If we need to go back to the development team for each new abstraction, we have a heavy weight process that the users will work around.&lt;/p&gt; &lt;p&gt;Most of my DSL contains some form of user define abstractions, usually in the form of:&lt;/p&gt; &lt;blockquote&gt;&lt;pre&gt;define bad_customer:
	customer.HasBadCredit or 
		customer.TotalReturnsIn(1.year) &amp;gt; 5 or
		customer.TotalHelpdeskCallsin(6.months) &amp;gt; 5

define silver_customer:
	customer.TotalPurchases &amp;gt; 5

define gold_customer:
	customer.TotalPurchasesAmount &amp;gt; 5000

define preferred_customer:
	gold_customer and not bad_customer
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;This is usually user editable, and we plug this into the intellisense of the system. In one project, I even provided a refactoring support, Extract Business Term (bound to CTRL+ALT+V, go R#!)&lt;/p&gt;
&lt;p&gt;Abstractions are important, and building them into the language is just as important. You &lt;em&gt;want&lt;/em&gt; to empower the users to extend your language, even if it a language that is very limited in scope. Because you give them the option to take the language to realms that you never dreamed on.&lt;/p&gt;&lt;img src="http://ayende.com/Blog/aggbug/10675.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ayende Rahien</dc:creator>
            <guid>http://ayende.com/Blog/archive/2008/12/23/should-you-be-able-to-define-new-abstractions-in-a.aspx</guid>
            <pubDate>Tue, 23 Dec 2008 01:58:55 GMT</pubDate>
            <comments>http://ayende.com/Blog/archive/2008/12/23/should-you-be-able-to-define-new-abstractions-in-a.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://ayende.com/Blog/comments/commentRss/10675.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>