<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Claudio Perrone&#039;s Monologues &#187; dsl</title>
	<atom:link href="http://www.agilesensei.com/articles/tag/dsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.agilesensei.com</link>
	<description>Personal and professional transformations in today&#039;s agile world</description>
	<lastBuildDate>Tue, 13 Jul 2010 15:57:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sick of Angle Brackets? DSL Modeling is (maybe) the Cure</title>
		<link>http://www.agilesensei.com/blog/articles/2006/03/19/sick-of-angle-brackets-dsl-modeling-is-maybe-the-cure/</link>
		<comments>http://www.agilesensei.com/blog/articles/2006/03/19/sick-of-angle-brackets-dsl-modeling-is-maybe-the-cure/#comments</comments>
		<pubDate>Sun, 19 Mar 2006 21:11:00 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[mdd]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Last week <a href="http://www.jnsk.se/weblog/">Jimmy Nilsson</a> <a href="http://www.jnsk.se/weblog/posts/TierXLanguages.htm">expressed</a> his growing dislike for today&#8217;s overuse of XML, particularly when conceived as a surrogate programming language. </p>

<p>I really share Jimmy&#8217;s concern, especially when I think about the XML <em>abuse</em> I&#8217;ve been subjected to while creating languages and recipes using the Domain-Specific Language (DSL) Tools and the Guidance Automation Toolkit (GAT).<br/>
On the other hand, I recognize that it is totally unfair for me to complain; this is, after all, the price we pay for dealing with prerelease software.<br/>
In fact, the DSL Tools team already announced that will soon provide us with a modeling language able to deal with the .dsldd file and hide that ugly XML from our sensitive eyes.<br/>
I haven&#8217;t heard of announcements regarding similar improvements on the GAT side, but I choose to be optimistic and wait for new developments.</p>

<p>Unfortunately this problem does not affect prereleases exclusively; released software, both closed and open source, is not immune either.<br/>
Let&#8217;s face it, it is far too easy to define and process a language using XML for not taking advantage of it; in a not-that-distant future, however, I have no doubts that we will look back and laugh thinking about how we put up with manually dealing with its angle brackets notation on a daily basis for all these years.</p>

<p>Apart from really extreme cases such as XSLT, perhaps XML-based build languages of the likes of <a href="http://ant.apache.org/">Ant</a>, <a href="http://nant.sourceforge.net/">NAnt</a> and <a href="http://channel9.msdn.com/wiki/default.aspx/MSBuild.HomePage">MSBuild</a> are among the most obvious and discussed examples of how a good idea can turn nasty when scenarios get a little more complex than anticipated.</p>

<p><a href="http://www.martinfowler.com/">Martin Fowler</a> already <a href="http://www.martinfowler.com/bliki/BuildLanguage.html">suggested</a> that today&#8217;s enterprise applications require pretty sophisticated builds which are better handled using a full-fledged programming language. </p>

<p>Last year, he also wrote an <a href="http://martinfowler.com/articles/rake.html">article</a> about his explorations using <a href="http://rake.rubyforge.org/">Rake</a>, a build language based on <a href="http://www.ruby-lang.org/en/20020101.html">Ruby</a>. In a nutshell, using an internal (text-based) domain-specific language such as Rake enables developers to easily switch to the external general-purpose language (Ruby) whenever necessary.</p>

<p>But how sophisticated can builds be? To put a little bit of perspective into things, let me tell you that for more than two years at <a href="http://www.innerworkings.com/">InnerWorkings</a> we have adopted a continuous integration solution based on <a href="http://confluence.public.thoughtworks.org/display/CCNET">CruiseControl. NET</a> and <a href="http://nant.sourceforge.net/">NAnt</a>; unless you&#8217;ve read Jimmy&#8217;s brilliant manuscript of his upcoming <a href="http://www.jnsk.se/weblog/posts/AfterAR.htm">book</a> (in which I was honored to make a small contribution as guest author) you will be surprised to hear that we manage to automatically and continuously build, obfuscate, package, test and deploy several <em>hundred</em> .NET solutions.<br/>
While I think that we have done more than a reasonable job at maintaining a good degree of modularity and reuse in our XML scripts, our tolerance to NAnt&#8217;s notation has been tested several times.</p>

<p>Resorting to a DSL written on top of a full programming language as Martin suggests would definitely help, but I have the impression that a purely text-based language may still be rather inadequate at solving one of the issues that we often face, particularly when dealing with many scripts in parallel like our scenario requires: lack of run-time visibility about the progress of each build.<br/>
Do I have a viable solution? I&#8217;m not sure, but I speculate that it won&#8217;t be long before we will see the raise of a new generation of continuous integration systems built around the upcoming <a href="http://msdn.microsoft.com/winfx/reference/workflow/default.aspx">Windows Workflow Foundation</a>, with steps defined using domain-specific activities.<br/>
What do you think? Is it a daft idea?</p>]]></description>
			<content:encoded><![CDATA[<p>Last week <a href="http://www.jnsk.se/weblog/">Jimmy Nilsson</a> <a href="http://www.jnsk.se/weblog/posts/TierXLanguages.htm">expressed</a> his growing dislike for today’s overuse of XML, particularly when conceived as a surrogate programming language. </p>
<p>I really share Jimmy’s concern, especially when I think about the XML <em>abuse</em> I’ve been subjected to while creating languages and recipes using the Domain-Specific Language (DSL) Tools and the Guidance Automation Toolkit (GAT).<br />
On the other hand, I recognize that it is totally unfair for me to complain; this is, after all, the price we pay for dealing with prerelease software.<br />
In fact, the DSL Tools team already announced that will soon provide us with a modeling language able to deal with the .dsldd file and hide that ugly XML from our sensitive eyes.<br />
I haven’t heard of announcements regarding similar improvements on the GAT side, but I choose to be optimistic and wait for new developments.</p>
<p>Unfortunately this problem does not affect prereleases exclusively; released software, both closed and open source, is not immune either.<br />
Let’s face it, it is far too easy to define and process a language using XML for not taking advantage of it; in a not-that-distant future, however, I have no doubts that we will look back and laugh thinking about how we put up with manually dealing with its angle brackets notation on a daily basis for all these years.</p>
<p>Apart from really extreme cases such as XSLT, perhaps XML-based build languages of the likes of <a href="http://ant.apache.org/">Ant</a>, <a href="http://nant.sourceforge.net/">NAnt</a> and <a href="http://channel9.msdn.com/wiki/default.aspx/MSBuild.HomePage">MSBuild</a> are among the most obvious and discussed examples of how a good idea can turn nasty when scenarios get a little more complex than anticipated.</p>
<p><a href="http://www.martinfowler.com/">Martin Fowler</a> already <a href="http://www.martinfowler.com/bliki/BuildLanguage.html">suggested</a> that today’s enterprise applications require pretty sophisticated builds which are better handled using a full-fledged programming language. </p>
<p>Last year, he also wrote an <a href="http://martinfowler.com/articles/rake.html">article</a> about his explorations using <a href="http://rake.rubyforge.org/">Rake</a>, a build language based on <a href="http://www.ruby-lang.org/en/20020101.html">Ruby</a>. In a nutshell, using an internal (text-based) domain-specific language such as Rake enables developers to easily switch to the external general-purpose language (Ruby) whenever necessary.</p>
<p>But how sophisticated can builds be? To put a little bit of perspective into things, let me tell you that for more than two years at <a href="http://www.innerworkings.com/">InnerWorkings</a> we have adopted a continuous integration solution based on <a href="http://confluence.public.thoughtworks.org/display/CCNET">CruiseControl. NET</a> and <a href="http://nant.sourceforge.net/">NAnt</a>; unless you’ve read Jimmy’s brilliant manuscript of his upcoming <a href="http://www.jnsk.se/weblog/posts/AfterAR.htm">book</a> (in which I was honored to make a small contribution as guest author) you will be surprised to hear that we manage to automatically and continuously build, obfuscate, package, test and deploy several <em>hundred</em> .NET solutions.</p>
<p>While I think that we have done more than a reasonable job at maintaining a good degree of modularity and reuse in our XML scripts, our tolerance to NAnt’s notation has been tested several times.</p>
<p>Resorting to a DSL written on top of a full programming language as Martin suggests would definitely help, but I have the impression that a purely text-based language may still be rather inadequate at solving one of the issues that we often face, particularly when dealing with many scripts in parallel like our scenario requires: lack of run-time visibility about the progress of each build.<br />
Do I have a viable solution? I’m not sure, but I speculate that it won’t be long before we will see the raise of a new generation of continuous integration systems built around the upcoming <a href="http://msdn.microsoft.com/winfx/reference/workflow/default.aspx">Windows Workflow Foundation</a>, with steps defined using domain-specific activities.<br />
What do you think? Is it a daft idea?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2006/03/19/sick-of-angle-brackets-dsl-modeling-is-maybe-the-cure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back on Track (and the Software Factories Architect Forum 2006)</title>
		<link>http://www.agilesensei.com/blog/articles/2006/03/13/back-on-track-and-the-software-factories-architect-forum-2006/</link>
		<comments>http://www.agilesensei.com/blog/articles/2006/03/13/back-on-track-and-the-software-factories-architect-forum-2006/#comments</comments>
		<pubDate>Mon, 13 Mar 2006 21:09:00 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[softwarefactories]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Despite the fact that you probably haven&#8217;t noticed or cared, I want to apologize for my lack of posting in the last few months.<br/>
Sure, I&#8217;ve been extremely busy, but in many ways I feel like I&#8217;ve been a horrible member of our software community, unfairly learning without sharing my findings with everyone else.<br/>
So here I am again, promising that I will try to contribute more in the future with the hope to encourage others to do the same.   </p>

<p>There are several things I feel I should write about (including the amazing software architecture workshop that took place last month in Cortina d&#8217;Ampezzo, Italy) but today I will just mention the more recent Microsoft Architect Forum 2006 which was superbly organized by <a href="http://blogs.msdn.com/bobrien/default.aspx">Bill O&#8217;Brien</a> here in Dublin.<br/>
I really couldn&#8217;t miss the full-day event since <a href="http://blogs.msdn.com/beatsch/">Beat Schwegler</a> and <a href="http://blogs.thinktecture.com/ingo/">Ingo Rammer</a> were set to dig deep into a topic that I simply can&#8217;t afford to ignore these days: <em>Software Factories</em> .   </p>

<p>Beat and Ingo were excellent in articulating Microsoft&#8217;s vision of how to combine model-driven development, guidance, frameworks and tools together with the objective of creating one or more <em>product lines</em> able to systematically exploit commonalities among the members of software <em>product families</em> .<br/>
Bill has kindly made available all the slides in this <a href="http://blogs.msdn.com/bobrien/archive/2006/03/03/542851.aspx">post</a> so I won&#8217;t go into the details of each session.   </p>

<p>During his analysis, Beat emphasized that we should consider that, in many cases, up to 70% of the cost of a software project goes into operations rather than pure development; as a consequence, he recommended that we should start adopting model-driven development not only for code generation, but also for requirements, deployment, configuration, and, more generally, for all other activities that are involved during the full lifecycle of a project.<br/>
While in principle I don&#8217;t disagree with this thought, today I find quite unlikely that different stakeholders (business analysts, network engineers, enterprise architects, solutions architects, developers, security specialists, QA testers, etc.) would accept to use the current incarnation of tools and designers and be confined to one single hosting environment, namely Visual Studio Team System.<br/>
But hey, in fairness we are talking about a medium-to-long term goal here, so I will surely change my mind on this point whenever Microsoft (or I :-)) will get there.   </p>

<p>Ingo was really impeccable throughout the day and used several examples to illustrate the capabilities of the DSL tools. In one specific instance however, I could not help but notice that the version of the domain specific language that he used did not provide a particular option he needed for his demonstration; he then resorted to manually modify the generated code to accomplish his objectives. Tut-tut Ingo, you are not supposed to do that ;-).<br/>
I know I know, it was just a demo, and I really sound way too fussy.   </p>

<p>It would be good however if somebody out there explained that, in the real world:  </p>

<ul>
<li><p>We obviously cannot modify code once generated since the DSL models will diligently overwrite everything at the next transformation; as a consequence:</p>

<ul>
<li>Put a comment header in each template to explain that <em>&#8220;This code has been generated by a tool&#8230;do no modify&#8230;etc.&#8221;</em> </li>
<li>Do not put the generated code under source control. That code is a dispensable artifact. Put the designer file and the templates under source control instead.</li>
</ul></li>
<li><p>Modifying a template is clearly a better option, generally however:</p>

<ul>
<li>You need to put it under source control</li>
<li>You need to deploy it in a centralized location so that it can be shared across different applications in the same family</li>
<li>A change in the template may not be done lightly as it could easily break all other existing solutions that use the same template.</li>
<li>You need to unambiguously identify the version in use (you may put a version number in the header of even resort to change file name if changes are substantial and break existing applications that use it)</li>
<li>A change in the template that breaks existing applications may trigger the beginning of a new product line, particularly if you can&#8217;t accomplish 100% code generation of a solution and you can&#8217;t afford to retrofit all the existing solutions. </li>
</ul></li>
<li><p>If we are unable to build systems that achieve 100% code generation (which happens if the degree of variation in a product family is not completely known):</p>

<ul>
<li>We need careful guidance (patterns) to understand how to happily write manual code beside generated code. How do we create the extension points? What do you put in the underlying frameworks and what do you keep in a template? Who should make the changes in the first place? Is it up to us to rediscover these tricks over and over? Sure we can use base classes, template methods, etc. But no, the one-size-fits-all solution of using partial classes does not work all the time (wake up people, we often deal with xml files with little or no control on the reader&#8230;has anyone heard of the app.config file for example?)</li>
<li>There is an evident abstraction leak as developers need to appreciate the generated code as they are going to write beside it and even debug it if necessary (tip: keep templates &#8220;thin&#8221; by leveraging rich frameworks instead). By the way, the idea that the &#8220;smartest&#8221; people will write DSLs and templates while the others will just use them is flawed in my opinion, but I will definitely save an explanation for another post.</li>
</ul></li>
</ul>

<p>I&#8217;m exhausted already and I&#8217;m aware that this list is far from complete; and I haven&#8217;t even started talking about how I see we could version a domain specific language or an entire product line using the current tools. Or maybe I should attempt to figure out how I would assemble effective teams within this new paradigm. Has anybody discussed yet how to deal with developer&#8217;s natural resistance to model-driven development? How should we address their concerns of domain-restricted job specialization and the rightful dislike for anything that contains the word <em>factory</em>  in it? Or has everybody agreed that this is not an issue?   </p>

<p>As often happens, the real problem is that the tools are getting there, with their capabilities and limitations, and we really need to go beyond the simple APIs to be good at using them.<br/>
But perhaps it is unfair to ask a toolmaker to tell us out how to excel at using those tools.<br/>
After all Mozart wasn&#8217;t a piano maker, right ;-)?  </p>]]></description>
			<content:encoded><![CDATA[<p>Despite the fact that you probably haven’t noticed or cared, I want to apologize for my lack of posting in the last few months.<br />
Sure, I’ve been extremely busy, but in many ways I feel like I’ve been a horrible member of our software community, unfairly learning without sharing my findings with everyone else.<br />
So here I am again, promising that I will try to contribute more in the future with the hope to encourage others to do the same.</p>
<p>There are several things I feel I should write about (including the amazing software architecture workshop that took place last month in Cortina d’Ampezzo, Italy) but today I will just mention the more recent Microsoft Architect Forum 2006 which was superbly organized by <a href="http://blogs.msdn.com/bobrien/default.aspx">Bill O’Brien</a> here in Dublin.<br />
I really couldn’t miss the full-day event since <a href="http://blogs.msdn.com/beatsch/">Beat Schwegler</a> and <a href="http://blogs.thinktecture.com/ingo/">Ingo Rammer</a> were set to dig deep into a topic that I simply can’t afford to ignore these days: <em>Software Factories</em> .</p>
<p>Beat and Ingo were excellent in articulating Microsoft’s vision of how to combine model-driven development, guidance, frameworks and tools together with the objective of creating one or more <em>product lines</em> able to systematically exploit commonalities among the members of software <em>product families</em> .<br />
Bill has kindly made available all the slides in this <a href="http://blogs.msdn.com/bobrien/archive/2006/03/03/542851.aspx">post</a> so I won’t go into the details of each session.</p>
<p>During his analysis, Beat emphasized that we should consider that, in many cases, up to 70% of the cost of a software project goes into operations rather than pure development; as a consequence, he recommended that we should start adopting model-driven development not only for code generation, but also for requirements, deployment, configuration, and, more generally, for all other activities that are involved during the full lifecycle of a project.</p>
<p>While in principle I don’t disagree with this thought, today I find quite unlikely that different stakeholders (business analysts, network engineers, enterprise architects, solutions architects, developers, security specialists, QA testers, etc.) would accept to use the current incarnation of tools and designers and be confined to one single hosting environment, namely Visual Studio Team System.<br />
But hey, in fairness we are talking about a medium-to-long term goal here, so I will surely change my mind on this point whenever Microsoft (or I <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) will get there.</p>
<p>Ingo was really impeccable throughout the day and used several examples to illustrate the capabilities of the DSL tools. In one specific instance however, I could not help but notice that the version of the domain specific language that he used did not provide a particular option he needed for his demonstration; he then resorted to manually modify the generated code to accomplish his objectives. Tut-tut Ingo, you are not supposed to do that <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .<br />
I know I know, it was just a demo, and I really sound way too fussy.</p>
<p>It would be good however if somebody out there explained that, in the real world:</p>
<ul>
<li>We obviously cannot modify code once generated since the DSL models will diligently overwrite everything at the next transformation; as a consequence:
<ul>
<li>Put a comment header in each template to explain that <em>“This code has been generated by a tool…do not modify…etc.”</em></li>
<li>Do not put the generated code under source control. That code is a dispensable artifact. Put the designer file and the templates under source control instead.</li>
</ul>
</li>
<li>Modifying a template is clearly a better option, generally however:
<ul>
<li>You need to put it under source control</li>
<li>You need to deploy it in a centralized location so that it can be shared across different applications in the same family</li>
<li>A change in the template may not be done lightly as it could easily break all other existing solutions that use the same template.</li>
<li>You need to unambiguously identify the version in use (you may put a version number in the header of even resort to change file name if changes are substantial and break existing applications that use it)</li>
<li>A change in the template that breaks existing applications may trigger the beginning of a new product line, particularly if you can’t accomplish 100% code generation of a solution and you can’t afford to retrofit all the existing solutions.</li>
</ul>
</li>
<li>If we are unable to build systems that achieve 100% code generation (which happens if the degree of variation in a product family is not completely known):
<ul>
<li>We need careful guidance (patterns) to understand how to happily write manual code beside generated code. How do we create the extension points? What do you put in the underlying frameworks and what do you keep in a template? Who should make the changes in the first place? Is it up to us to rediscover these tricks over and over? Sure we can use base classes, template methods, etc. But no, the one-size-fits-all solution of using partial classes does not work all the time (wake up people, we often deal with xml files with little or no control on the reader…has anyone heard of the app.config file for example?)</li>
<li>There is an evident abstraction leak as developers need to appreciate the generated code as they are going to write beside it and even debug it if necessary (tip: keep templates “thin” by leveraging rich frameworks instead). By the way, the idea that the “smartest” people will write DSLs and templates while the others will just use them is flawed in my opinion, but I will definitely save an explanation for another post.</li>
</ul>
</li>
</ul>
<p>I’m exhausted already and I’m aware that this list is far from complete; and I haven’t even started talking about how I see we could version a domain specific language or an entire product line using the current tools. Or maybe I should attempt to figure out how I would assemble effective teams within this new paradigm. Has anybody discussed yet how to deal with developer’s natural resistance to model-driven development? How should we address their concerns of domain-restricted job specialization and the rightful dislike for anything that contains the word <em>factory</em>  in it? Or has everybody agreed that this is not an issue?</p>
<p>As often happens, the real problem is that the tools are getting there, with their capabilities and limitations, and we really need to go beyond the simple APIs to be good at using them.<br />
But perhaps it is unfair to ask a toolmaker to tell us out how to excel at using those tools.<br />
After all Mozart wasn’t a piano maker, right <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2006/03/13/back-on-track-and-the-software-factories-architect-forum-2006/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>DSLs are not frameworks</title>
		<link>http://www.agilesensei.com/blog/articles/2005/12/13/dsls-are-not-frameworks/</link>
		<comments>http://www.agilesensei.com/blog/articles/2005/12/13/dsls-are-not-frameworks/#comments</comments>
		<pubDate>Tue, 13 Dec 2005 21:07:00 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsl]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>If you consider domain specific modeling products as simply glorified code generation tools, you might get away with just rushing through the product documentation and jotting down the first thing that comes to your mind. </p>

<p>However, as vendors are becoming more successful in fulfilling the promise of enabling people within organizations to model their own domain specific languages, many are realizing that simply mastering the features (and limitations) of a particular modeling tool is manifestly insufficient. </p>

<p>I&#8217;m certainly not trying to classify such tools as interchangeable commodities; in fact, I speculate that, at least for the next few years, the choice of one tool versus another could easily contribute to the failure of a project.<br/>
There are already several documented cases of organizations that use modeling tools to drive entire product lines with enormous success. Frankly, I just assume that the very same tools have been employed within different realities with opposite results.</p>

<p>One of the goals for DSL authors is to generate as much code as possible whilst hiding implementation details behind reasonably flexible models and notations. This goal presents challenges that go beyond the tool in use. </p>

<p>If it is that hard, who should create DSLs? Will organizations need to create a specialized development role as some are arguing?<br/>
It is realistic to assume that experienced developers/architects who fully understand the domain and have been involved in the development of enterprise frameworks are the natural candidates for authoring well thought DSLs for an individual organization.   </p>

<p>On the other hand, there is a danger that such authors might treat DSLs <em>exactly</em> like class frameworks, without realizing that the forces at work are significantly different. </p>

<p>When building frameworks we don&#8217;t necessarily know how our components will be consumed. For example, if we create a custom control and omit to expose a particular event, the entire control might turn out to be totally unsuitable for a whole category of users. It is then reasonable to take a &#8220;safe&#8221; approach by adding extra options, in the form of events, method overloads, extra parameters, extensibility patterns, etc. </p>

<p>However, using this tactic for DSLs would lead us to create &#8220;flexible&#8221; implementations of a language through the introduction of (superfluous) <em>configuration/customization</em> options to our models, without considering that every time we add an extra element, attribute or connection to a DSL we arguably make the language more difficult to use and, ironically, less adaptable: </p>

<ul>
<li>It is more difficult from the user perspective because there are more elements in the language to understand and deal with. </li>
<li>It is less resilient to change because those options might expose subtle aspects of design and implementation of a solution that, over time, would be harder to modify and improve. </li>
</ul>

<p>Of course, since we want to use DSLs to solve categories of problems, we cannot totally eliminate all forms of variation, but my point is that, in order to add flexibility to a domain specific language, we should take a systematic approach and <em>reduce options</em> rather than blindly increase them!<br/>
Is it possible? Yes, if we narrow the scope of application of the language to a well-known domain and we favor <em>abstractions</em> and <em>conventions</em> over <em>configuration options</em>. </p>]]></description>
			<content:encoded><![CDATA[<p>If you consider domain specific modeling products as simply glorified code generation tools, you might get away with just rushing through the product documentation and jotting down the first thing that comes to your mind. </p>
<p>However, as vendors are becoming more successful in fulfilling the promise of enabling people within organizations to model their own domain specific languages, many are realizing that simply mastering the features (and limitations) of a particular modeling tool is manifestly insufficient. </p>
<p>I’m certainly not trying to classify such tools as interchangeable commodities; in fact, I speculate that, at least for the next few years, the choice of one tool versus another could easily contribute to the failure of a project.<br />
There are already several documented cases of organizations that use modeling tools to drive entire product lines with enormous success. Frankly, I just assume that the very same tools have been employed within different realities with opposite results.</p>
<p>One of the goals for DSL authors is to generate as much code as possible whilst hiding implementation details behind reasonably flexible models and notations. This goal presents challenges that go beyond the tool in use. </p>
<p>If it is that hard, who should create DSLs? Will organizations need to create a specialized development role as some are arguing?<br />
It is realistic to assume that experienced developers/architects who fully understand the domain and have been involved in the development of enterprise frameworks are the natural candidates for authoring well thought DSLs for an individual organization.   </p>
<p>On the other hand, there is a danger that such authors might treat DSLs <em>exactly</em> like class frameworks, without realizing that the forces at work are significantly different. </p>
<p>When building frameworks we don’t necessarily know how our components will be consumed. For example, if we create a custom control and omit to expose a particular event, the entire control might turn out to be totally unsuitable for a whole category of users. It is then reasonable to take a “safe” approach by adding extra options, in the form of events, method overloads, extra parameters, extensibility patterns, etc. </p>
<p>However, using this tactic for DSLs would lead us to create “flexible” implementations of a language through the introduction of (superfluous) <em>configuration/customization</em> options to our models, without considering that every time we add an extra element, attribute or connection to a DSL we arguably make the language more difficult to use and, ironically, less adaptable: </p>
<ul>
<li>It is more difficult from the user perspective because there are more elements in the language to understand and deal with. </li>
<li>It is less resilient to change because those options might expose subtle aspects of design and implementation of a solution that, over time, would be harder to modify and improve. </li>
</ul>
<p>Of course, since we want to use DSLs to solve categories of problems, we cannot totally eliminate all forms of variation, but my point is that, in order to add flexibility to a domain specific language, we should take a systematic approach and <em>reduce options</em> rather than blindly increase them!<br />
Is it possible? Yes, if we narrow the scope of application of the language to a well-known domain and we favor <em>abstractions</em> and <em>conventions</em> over <em>configuration options</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2005/12/13/dsls-are-not-frameworks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clipcode-GoF-DSL and the One-To-One Mapping Anti-Pattern</title>
		<link>http://www.agilesensei.com/blog/articles/2005/08/08/clipcode-gof-dsl-and-the-one-to-one-mapping-anti-pattern/</link>
		<comments>http://www.agilesensei.com/blog/articles/2005/08/08/clipcode-gof-dsl-and-the-one-to-one-mapping-anti-pattern/#comments</comments>
		<pubDate>Mon, 08 Aug 2005 21:04:00 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Last week Eamon O&#8217;Tuathail of <a href="http://www.clipcode.biz/workshops/dsl.html">Clipcode</a> released a <a href="http://www.clipcode.biz/workshops/dsl.html">Domain Specific Language (DSL)</a> for some of the <a href="http://en.wikipedia.org/wiki/GoF">Gang of Four</a> design patterns using the<a href="http://developers.ie/blogs/cperrone/archive/2005/06/10/972.aspx">Microsoft DSL Tools for Visual Studio 2005</a>.<br/>
It is indeed a very remarkable proof of concept and although the implementation is still pretty rough, it represents a valuable model for discussion and learning.</p>

<p>Eamon is very active (particularly) within the Irish community and he is a regular speaker at the <a href="http://www.developers.ie/">Irish .Net Developer Alliance (INDA)</a> events where I often see him.<br/>
I briefly talked to him last night as we both were present at the excellent <a href="http://weblogs.asp.net/rosherove/">Roy Osherove</a>&#8217;s talk on agile development and unit testing best practices.<br/>
Eamon told me that he only spent a couple of days developing it; this is something I consider rather impressive given the premature stage of the supporting tools currently available (I bet that his superb documentation took him more time to develop ;-)).  </p>

<p>The DSL designer currently allows setup and code generation for five patterns:</p>

<ul>
<li>Abstract Factory</li>
<li>Builder</li>
<li>Factory Method</li>
<li>Prototype</li>
<li>Singleton</li>
</ul>

<p>Overall, I liked the organization of the code templates in the debug solution, as they are neatly located in a common folder and are referenced only through the ClipcodeEngineTransform.ReportTemplate file which acts as a *template controller *for all the instantiated designers. </p>

<p>Besides some understandable limitations of both the language and the underlying platform (i.e. the DSL Tools) that will be undoubtedly addressed in future releases, my main interest (and point of concern) lies in the level of abstraction of the model.</p>

<p>Using the language to generate code that realizes a pattern is pretty straightforward as the designer diligently constrains allowable classes and connections.<br/>
However, my worry is that, in order to realize a pattern, you need to select every single participant (class/object) from the toolbox and manually connect it to the permitted collaborator(s). As a consequence, you end up creating a diagram that matches quite closely the classic UML representation of each pattern. But do we really need to visualize the structure of a pattern? </p>

<p>As my exploration of the Domain-Specific Modeling (DSM) world progresses, I&#8217;m more and more obsessed by the idea that if we want to create the biggest ROI, it is essential to push our models towards a level of abstraction that is <em>significantly</em> higher than the level at which code statements and classes are written.<br/>
In other words, a <em>one-to-one mapping</em> between a class created in a diagram and a class generated in code does not generally save enough time and I would dare to consider it an <em>anti-pattern</em>.<br/>
A symptom is that the toolbox is generally filled with lots of different elements even if the main concepts (in this case the GoF patterns) are more coarse grained.</p>

<p>So here is a challenge that anyone interested can take. In order to realize an abstract factory, I should need to drag only one class on the designer (e.g. AbstractClassRealization) and setup its participants (AbstractFactory, ConcreteFactory, AbstractProduct, ConcreteProduct) using compartments only. Is it possible? I guess so. I will try soon anyways.</p>

<p>By the way, if you think about it, a GoF pattern is still at a pretty low level of abstraction. In fact, it is the very essence of an OO pattern to address recurring cross-domain concerns. So a &#8220;real&#8221; DSL may still be built on top of it and possibly provide an even higher return of investment for your organization.</p>]]></description>
			<content:encoded><![CDATA[<p>Last week Eamon O’Tuathail of <a href="http://www.clipcode.biz/workshops/dsl.html">Clipcode</a> released a <a href="http://www.clipcode.biz/workshops/dsl.html">Domain Specific Language (DSL)</a> for some of the <a href="http://en.wikipedia.org/wiki/GoF">Gang of Four</a> design patterns using the<a href="http://developers.ie/blogs/cperrone/archive/2005/06/10/972.aspx">Microsoft DSL Tools for Visual Studio 2005</a>.</p>
<p>It is indeed a very remarkable proof of concept and although the implementation is still pretty rough, it represents a valuable model for discussion and learning.</p>
<p>Eamon is very active (particularly) within the Irish community and he is a regular speaker at the <a href="http://www.developers.ie/">Irish .Net Developer Alliance (INDA)</a> events where I often see him.<br />
I briefly talked to him last night as we both were present at the excellent <a href="http://weblogs.asp.net/rosherove/">Roy Osherove</a>’s talk on agile development and unit testing best practices.<br />
Eamon told me that he only spent a couple of days developing it; this is something I consider rather impressive given the premature stage of the supporting tools currently available (I bet that his superb documentation took him more time to develop <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ).</p>
<p>The DSL designer currently allows setup and code generation for five patterns:</p>
<ul>
<li>Abstract Factory</li>
<li>Builder</li>
<li>Factory Method</li>
<li>Prototype</li>
<li>Singleton</li>
</ul>
<p>Overall, I liked the organization of the code templates in the debug solution, as they are neatly located in a common folder and are referenced only through the ClipcodeEngineTransform.ReportTemplate file which acts as a <em>template controller</em> for all the instantiated designers.</p>
<p>Besides some understandable limitations of both the language and the underlying platform (i.e. the DSL Tools) that will be undoubtedly addressed in future releases, my main interest (and point of concern) lies in the level of abstraction of the model.</p>
<p>Using the language to generate code that realizes a pattern is pretty straightforward as the designer diligently constrains allowable classes and connections.<br />
However, my worry is that, in order to realize a pattern, you need to select every single participant (class/object) from the toolbox and manually connect it to the permitted collaborator(s). As a consequence, you end up creating a diagram that matches quite closely the classic UML representation of each pattern. But do we really need to visualize the structure of a pattern?</p>
<p>As my exploration of the Domain-Specific Modeling (DSM) world progresses, I’m more and more obsessed by the idea that if we want to create the biggest ROI, it is essential to push our models towards a level of abstraction that is <em>significantly</em> higher than the level at which code statements and classes are written.<br />
In other words, a <em>one-to-one mapping</em> between a class created in a diagram and a class generated in code does not generally save enough time and I would dare to consider it an <em>anti-pattern</em>.</p>
<p>A symptom is that the toolbox is generally filled with lots of different elements even if the main concepts (in this case the GoF patterns) are more coarse grained.</p>
<p>So here is a challenge that anyone interested can take. In order to realize an abstract factory, I should need to drag only one class on the designer (e.g. AbstractClassRealization) and setup its participants (AbstractFactory, ConcreteFactory, AbstractProduct, ConcreteProduct) using compartments only. Is it possible? I guess so. I will try soon anyways.</p>
<p>By the way, if you think about it, a GoF pattern is still at a pretty low level of abstraction. In fact, it is the very essence of an OO pattern to address recurring cross-domain concerns. So a “real” DSL may still be built on top of it and possibly provide an even higher return of investment for your organization.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2005/08/08/clipcode-gof-dsl-and-the-one-to-one-mapping-anti-pattern/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tech-Ed and Domain Specific Languages</title>
		<link>http://www.agilesensei.com/blog/articles/2005/06/10/tech-ed-and-domain-specific-languages/</link>
		<comments>http://www.agilesensei.com/blog/articles/2005/06/10/tech-ed-and-domain-specific-languages/#comments</comments>
		<pubDate>Fri, 10 Jun 2005 20:55:00 +0000</pubDate>
		<dc:creator>Claudio Perrone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[teched]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Wednesday&#8217;s session about the DSL tools for Model-Driven Development in VS2005 was truly fascinating. Actually, I think that it justifies the investment of my trip across the Atlantic alone!</p>

<p>After illustrating that domain specific languages are ways to improve effectiveness in communication, <a href="http://209.34.241.67/jochens/archive/2005/06/05/425464.aspx">Jochen Seemann</a> literally blew my mind by demonstrating what can be done today with the CTP release version of the upcoming <a href="http://lab.msdn.microsoft.com/teamsystem/Workshop/DSLTools">Microsoft Domain-Specific Language (DSL) Tools</a>. </p>

<p>This SDK allows you to <em>easily</em> build a graphical designer hosted by Visual Studio 2005 that is able to provide support for a custom domain-specific language. </p>

<p>What does it mean? Once the designer is built, a user can instantiate the designer, drag custom shapes from the toolbox, connect those shapes together (with validation support according to the language rules) and use the template engine to generate code/artifacts!</p>

<p>Building a DSL designer requires several steps, which basically involve the definition of:</p>

<ul>
<li>the elements of our domain in a domain model (classes and relationships)</li>
<li>the notational elements (shapes and connectors) for the business entities</li>
<li>the legal rules (validation/constraints) from a notational perspective, and the mapping of the notation to the elements of our domain.</li>
</ul>

<p>Once the designer is built and instantiated we can use template-based generators to generate artifacts from our model (e.g. code, HTML, XML, WordML, etc). The templates have a notation similar to CodeSmith or classic ASP, and in the future some form of Intellisense (to query the model) is likely to be provided.</p>

<p>Some of these steps currently require the editing of an XML file. However Jochen said that this is really an &#8220;alpha&#8221; version of the toolkit and that better support will be provided in further iterations (indeed, the textual generator engine, code named T4, is only 6 weeks old!).<br/>
He plans to release incremental versions of the toolkit every 2-3 months, maybe even after version 1.0 will be shipped.</p>

<p>Currently I have only a few random observations/considerations on DSL designers that I want to dump here for my reference and eventually refine in future posts as I become more experienced in this field:</p>

<ul>
<li>We can build multiple designers to generate different parts in our systems, so we can (and probably should) start small.</li>
<li>2-Way synchronization (e.g. graphical model &#8211; to generated code &#8211; back to graphical model) is probably not going to be provided with version 1.0. It is a difficult problem to solve and I agree with Jochen&#8217;s pragmatism that it would be a fundamental feature only in a relatively small number of cases.</li>
<li>Template/designer versioning and deployment are going to be difficult issues. We will need a defined structure and guidelines to avoid dealing with a total mess.</li>
<li>A DSL designer is likely to work effectively in areas when the domain entities are very well understood. I can see how the use of a ubiquitous language would be core in this context.</li>
<li>DSL designers could be used for requirements; however I have some reservation in this direction as the domain model is likely to be refined and changed way too quickly in a real world scenario. Use cases, CRC cards, and UML drafts are still likely to be my preferred option in the short term. I might be totally wrong on this, and I hope somebody can change my ideas soon (any volunteers?).</li>
<li>There is a space for graphic tools and a space for code. A guy asked if Microsoft was going to provide basic notational elements that would give us very fine grained control capabilities (ifs, whiles etc). I think that writing code using shapes is insane. This is not a new idea (companies have been trying for years to propose solutions in this direction) but when you get pages and pages of icons you quickly realize that you are in the wrong space.</li>
<li>Code generation driven by a designer is very cool. However writing templates is a pain and it feels like going back to messy scripting languages.</li>
<li>Aspect Orientation could have a major role in this type of development. You add an attribute to a shape and (with the right template) your code magically gets to be generated. Jochen is not totally convinced by the feasibility of the AO approach as many people got burned. After talking to the guys in Avanade, however, I&#8217;ll be willing to take a serious shot in my problem space.</li>
<li>It will be fundamental to maintain a clear separation between generated code and custom code. Use of partial classes that can be regenerated would be an option, separate classes and aggregation/inheritance another. </li>
<li>I wish we could have several injection points in the designer and even a link to MSBuild, so that separate tasks could be executed upon code generation.</li>
</ul>

<p>I hope this post gave you a sense of what this technology can provide. As I said at the beginning, I&#8217;ve been totally fascinated by it.<br/>
Finally let me just say that this technology gave me a fantastic idea that promises to provide an incredibly elegant solution to a huge problem in <a href="http://www.innerworkings.com">Innerworkings</a>&#8217; domain. Unfortunately I&#8217;m only teasing you guys because I can&#8217;t tell you what it is, as probably Fran (my CEO) would literally kill me if I did :-)</p>]]></description>
			<content:encoded><![CDATA[<p>Wednesday’s session about the DSL tools for Model-Driven Development in VS2005 was truly fascinating. Actually, I think that it justifies the investment of my trip across the Atlantic alone!</p>
<p>After illustrating that domain specific languages are ways to improve effectiveness in communication, <a href="http://209.34.241.67/jochens/archive/2005/06/05/425464.aspx">Jochen Seemann</a> literally blew my mind by demonstrating what can be done today with the CTP release version of the upcoming <a href="http://lab.msdn.microsoft.com/teamsystem/Workshop/DSLTools">Microsoft Domain-Specific Language (DSL) Tools</a>. </p>
<p>This SDK allows you to <em>easily</em> build a graphical designer hosted by Visual Studio 2005 that is able to provide support for a custom domain-specific language. </p>
<p>What does it mean? Once the designer is built, a user can instantiate the designer, drag custom shapes from the toolbox, connect those shapes together (with validation support according to the language rules) and use the template engine to generate code/artifacts!</p>
<p>Building a DSL designer requires several steps, which basically involve the definition of:</p>
<ul>
<li>the elements of our domain in a domain model (classes and relationships)</li>
<li>the notational elements (shapes and connectors) for the business entities</li>
<li>the legal rules (validation/constraints) from a notational perspective, and the mapping of the notation to the elements of our domain.</li>
</ul>
<p>Once the designer is built and instantiated we can use template-based generators to generate artifacts from our model (e.g. code, HTML, XML, WordML, etc). The templates have a notation similar to CodeSmith or classic ASP, and in the future some form of Intellisense (to query the model) is likely to be provided.</p>
<p>Some of these steps currently require the editing of an XML file. However Jochen said that this is really an “alpha” version of the toolkit and that better support will be provided in further iterations (indeed, the textual generator engine, code named T4, is only 6 weeks old!).<br />
He plans to release incremental versions of the toolkit every 2-3 months, maybe even after version 1.0 will be shipped.</p>
<p>Currently I have only a few random observations/considerations on DSL designers that I want to dump here for my reference and eventually refine in future posts as I become more experienced in this field:</p>
<ul>
<li>We can build multiple designers to generate different parts in our systems, so we can (and probably should) start small.</li>
<li>2-Way synchronization (e.g. graphical model – to generated code – back to graphical model) is probably not going to be provided with version 1.0. It is a difficult problem to solve and I agree with Jochen’s pragmatism that it would be a fundamental feature only in a relatively small number of cases.</li>
<li>Template/designer versioning and deployment are going to be difficult issues. We will need a defined structure and guidelines to avoid dealing with a total mess.</li>
<li>A DSL designer is likely to work effectively in areas when the domain entities are very well understood. I can see how the use of a ubiquitous language would be core in this context.</li>
<li>DSL designers could be used for requirements; however I have some reservation in this direction as the domain model is likely to be refined and changed way too quickly in a real world scenario. Use cases, CRC cards, and UML drafts are still likely to be my preferred option in the short term. I might be totally wrong on this, and I hope somebody can change my ideas soon (any volunteers?).</li>
<li>There is a space for graphic tools and a space for code. A guy asked if Microsoft was going to provide basic notational elements that would give us very fine grained control capabilities (ifs, whiles etc). I think that writing code using shapes is insane. This is not a new idea (companies have been trying for years to propose solutions in this direction) but when you get pages and pages of icons you quickly realize that you are in the wrong space.</li>
<li>Code generation driven by a designer is very cool. However writing templates is a pain and it feels like going back to messy scripting languages.</li>
<li>Aspect Orientation could have a major role in this type of development. You add an attribute to a shape and (with the right template) your code magically gets to be generated. Jochen is not totally convinced by the feasibility of the AO approach as many people got burned. After talking to the guys in Avanade, however, I’ll be willing to take a serious shot in my problem space.</li>
<li>It will be fundamental to maintain a clear separation between generated code and custom code. Use of partial classes that can be regenerated would be an option, separate classes and aggregation/inheritance another. </li>
<li>I wish we could have several injection points in the designer and even a link to MSBuild, so that separate tasks could be executed upon code generation.</li>
</ul>
<p>I hope this post gave you a sense of what this technology can provide. As I said at the beginning, I’ve been totally fascinated by it.<br />
Finally let me just say that this technology gave me a fantastic idea that promises to provide an incredibly elegant solution to a huge problem in <a href="http://www.innerworkings.com">Innerworkings</a>’ domain. Unfortunately I’m only teasing you guys because I can’t tell you what it is, as probably Fran (my CEO) would literally kill me if I did <img src='http://www.agilesensei.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.agilesensei.com/blog/articles/2005/06/10/tech-ed-and-domain-specific-languages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
