<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jean-Marc Prieur's Blog : DSL Tools</title><link>http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx</link><description>Tags: DSL Tools</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>An Article about DSLs and WPF : “Provide an improved user experience to your DSLs”</title><link>http://blogs.msdn.com/jmprieur/archive/2009/09/22/an-article-about-dsls-and-wpf-provide-an-improved-user-experience-to-your-dsls.aspx</link><pubDate>Tue, 22 Sep 2009 09:01:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897865</guid><dc:creator>jmprieur</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9897865.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9897865</wfw:commentRss><description>&lt;p&gt;Pascal Recchia and Anthony Guérot from &lt;a href="http://www.mexedge.com/"&gt;Mexedge&lt;/a&gt; just published a new article: &amp;quot;&lt;em&gt;Provide an improved user experience to your DSL's&lt;/em&gt;&amp;quot; about how to use WPF with your DSLs even in Visual Studio 2008. The technology they use is similar to what we ship in the DSL Tools for Visual Studio 2010.    &lt;br /&gt;&lt;a href="http://www.netfxfactory.org/blogs/papers/archive/2009/09/20/provide-an-improved-user-experience-to-your-dsls.aspx"&gt;http://www.netfxfactory.org/blogs/papers/archive/2009/09/20/provide-an-improved-user-experience-to-your-dsls.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The article has been published with 2 videos:    &lt;br /&gt;&lt;a href="http://www.netfxfactory.org/videos/stepbystep.wmv"&gt;http://www.netfxfactory.org/videos/stepbystep.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://www.netfxfactory.org/videos/airtraffic.wmv"&gt;http://www.netfxfactory.org/videos/airtraffic.wmv&lt;/a&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;the code is available from:   &lt;br /&gt;&lt;a href="http://www.netfxfactory.org/files/airtraffic.zip"&gt;http://www.netfxfactory.org/files/airtraffic.zip&lt;/a&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;And the article is even available in PDF format:   &lt;br /&gt;&lt;a href="http://www.netfxfactory.org/docs/Provide_an_improved_user_experience_to_your_DSLs.pdf"&gt;http://www.netfxfactory.org/docs/Provide_an_improved_user_experience_to_your_DSLs.pdf&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Very nice!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897865" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>Copy / Cut / Paste of model elements</title><link>http://blogs.msdn.com/jmprieur/archive/2009/07/22/copy-cut-paste-of-model-elements.aspx</link><pubDate>Wed, 22 Jul 2009 03:43:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844107</guid><dc:creator>jmprieur</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9844107.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9844107</wfw:commentRss><description>&lt;h3&gt;Behavior in previous versions of the DSL Tools&lt;/h3&gt;  &lt;p&gt;In previous versions of the DSL Tools, the copy/cut/paste of model elements did not work very well. There were limitations, and even bugs that prevented very elaborate scenarios. In case you are interested, you can have to the posts on the &lt;a href="http://social.msdn.microsoft.com/Search/en-US/?Refinement=112&amp;amp;query=Copy%20Paste%20%5bDSL%5d&amp;amp;rq=meta:Search.MSForums.ForumID(a6b3f7be-4a18-4637-a55a-41b5596cd903)&amp;amp;rn=Visual+Studio+Extensibility+Forum" target="_blank"&gt;forum&lt;/a&gt; describing these problems, and the pain there was in this area. Some people in the community were successful on some models (See for instance Pascal Recchia and Anthony Guérot’s article on toolbox prototypes, which uses the copy/paste mechanism: &lt;a title="http://netfxfactory.org/blogs/papers/archive/2008/06/25/snip-your-dsl-into-prototypes.aspx" href="http://netfxfactory.org/blogs/papers/archive/2008/06/25/snip-your-dsl-into-prototypes.aspx"&gt;http://netfxfactory.org/blogs/papers/archive/2008/06/25/snip-your-dsl-into-prototypes.aspx&lt;/a&gt;), but the feature needed reworking and this is what we had done.&lt;/p&gt;  &lt;h3&gt;New behavior in VS2010&lt;/h3&gt;  &lt;p&gt;From the VS2010 DSL SDK, the copy/paste as an image is available to all the new designers, and it’s easy to provide the feature for existing migrated designers. &lt;/p&gt;  &lt;h4&gt;What is the behavior for the DSL user?&lt;/h4&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The DSL user will be able to copy model elements, compartments items, or anything that the DSL Author thought about, or cut them, and paste them in a compatible shape, in the same, or in different designers. and this in a very natural way.&lt;/p&gt;  &lt;h4&gt;How does the DSL author control this?&lt;/h4&gt;  &lt;p&gt;If you create a new graphical designer, you don’t need to do anything, the copy/paste is enabled by default. &lt;/p&gt;  &lt;p&gt;If you migrate an existing designer, you can benefit from this new feature very simply: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Having opened the DslDefinition.dsl, go to the DSL Explorer; in the Editor node, you’ll find a new property named “Enable Copy Paste”,      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Set “Enable Copy Paste” to CopyPasteOnly (the default is NoGeneratedCopyPaste in case of migrated designers because we did not want to break your designers in case you were successful in implementing the copy/paste already, and CopyPasteOnly for new designers)      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;On each domain role, determine if you want the “copy closure” to pass trough the role. For this you have a property named “Propagates Copy” that values:     &lt;br /&gt;- &lt;strong&gt;Do Not Propagate Copy&lt;/strong&gt;, if you don’t want to “navigate” through the role when copying from the opposite domain class      &lt;br /&gt;- &lt;strong&gt;Propagate Copy To Link Only&lt;/strong&gt;, if you want to copy the link, but not the targeted domain class      &lt;br /&gt;- &lt;strong&gt;Propagates Copy To Link And Opposite Role Player&lt;/strong&gt;, if you want to copy the link, and the targeted domain class      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_thumb.png" width="356" height="272" /&gt;&lt;/a&gt;       &lt;br /&gt;      &lt;br /&gt;In new designers, the default is &lt;strong&gt;Propagates Copy To Link And Opposite Role Player&lt;/strong&gt; for embeddings, and &lt;strong&gt;Do Not Propagate Copy&lt;/strong&gt; for the others      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Transform All Templates &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;Example on the DSL class diagram template&lt;/h4&gt;  &lt;p&gt;More concretely. Let’s take the example of a class diagram unfolded form a Class diagram DSL template. The following screen shot shows a portion of the domain model (Class has attributes), and you can see that being an embedding, by default, Propagates Copy is set for the Attributes role to &lt;strong&gt;Propagates Copy To Link And Opposite Role Player.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;What this means is each time you copy a ModelClass, you’ll copy its attributes at the same time, which is, really what most people expect.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_thumb_1.png" width="1448" height="764" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now let’s go a bit further, and change the behavior a bit. Let’s assume we have a base class Moveable, and copy the derived class (Plane), and paste it on the diagram. By default, you end up with a new class (Plane1) whose attributes and methods were cloned:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_thumb_2.png" width="401" height="352" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now let’s assume that, as a DSL author, I want, each time we copy and paste a class (such as Plane), the inheritance, if any, to be copied as well (thus keeping the link with the base class):&lt;/p&gt;  &lt;p&gt;To achieve this I need to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Figure out which role I navigate through when I copy Plane to get the inheritance: this is &lt;strong&gt;Superclass.&lt;/strong&gt;&lt;/li&gt;    &lt;li&gt;Change the &lt;strong&gt;PropagateCopy&lt;/strong&gt; property value of the &lt;strong&gt;Superclass&lt;/strong&gt; role to &lt;strong&gt;Propagate Copy To Link Only&lt;/strong&gt;&lt;/li&gt;    &lt;li&gt;Transform all templates&lt;/li&gt;    &lt;li&gt;Rebuild&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, when the designer user copies the class “Plane”, he gets a clone, with the inheritance relationship still linking to the same base class … just what I wanted.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/CopyCutPasteofmodelelements_9A1D/image_thumb_3.png" width="581" height="354" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9844107" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>Moveable decorators</title><link>http://blogs.msdn.com/jmprieur/archive/2009/07/16/moveable-decorators.aspx</link><pubDate>Thu, 16 Jul 2009 16:15:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9835597</guid><dc:creator>jmprieur</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9835597.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9835597</wfw:commentRss><description>&lt;h3&gt;Behavior in previous versions of the DSL Tools&lt;/h3&gt;  &lt;p&gt;In previous versions of the DSL Tools, such as, in the DSL Class diagram which is provided as a sample, you could very easily end-up with a very cluttered diagram:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb.png" width="248" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h3&gt;New behavior&lt;/h3&gt;  &lt;p&gt;With the moveable decorators feature, the DSL author can choose let the decorators on a connector be moveable by the user.&lt;/p&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;h4&gt;How the DSL author enables the moveable decorators?&lt;/h4&gt;  &lt;ol&gt;   &lt;li&gt;In the DslDefinition.dsl file, select the decorators of the connector that you want to let moveable. Note in the picture below that I selected the four decorators of the AssociationConnector&lt;/li&gt;    &lt;li&gt;In the Properties window, change the &lt;strong&gt;IsMoveable&lt;/strong&gt; property to True&lt;/li&gt;    &lt;li&gt;Transform All templates and rebuild&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_1.png" width="710" height="584" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h4&gt;What is the behavior for the user?&lt;/h4&gt;  &lt;p&gt;Having letting the decorators on this connector being moveable, the designer’s user will now be able to drag each of them to the position of his/her choice:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_2.png" width="308" height="152" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If the user selects a decorator, it will be visualized with a segment from the original location to the moved location&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_3.png" width="319" height="218" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If the user selects the connector, all the segments from the connector to the moved position will be displayed:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_4.png" width="345" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If the user wants to reset the location of a moved decorator to its original location, there is a contextual command &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_5.png" width="396" height="228" /&gt;&lt;/a&gt;&amp;#160; which let the decorator get it’s original location &lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_16.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Moveabledecorators_C1D7/image_thumb_7.png" width="376" height="190" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Improvements for Beta2&lt;/h3&gt;  &lt;p&gt;In Beta1, the segments from the connector to the decorators are visible even if the displayed text is empty, which a few customers have found to be is a bit confusing. Therefore, in Beta2 these lines will be invisible if the text is empty, and the empty decorators won’t be selectable.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9835597" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>Sticky toolbox items</title><link>http://blogs.msdn.com/jmprieur/archive/2009/07/16/sticky-toolbox-items.aspx</link><pubDate>Thu, 16 Jul 2009 14:16:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9835490</guid><dc:creator>jmprieur</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9835490.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9835490</wfw:commentRss><description>&lt;h3&gt;&lt;strong&gt;Behavior in previous versions of the DSL Tools&lt;/strong&gt;&lt;/h3&gt;  &lt;p&gt;In previous versions of the DSL Tools, each time you wanted to create a shape or a connector, you had to:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;go to the toolbox, and click on the domain shape / connector that you wanted to create &lt;/li&gt;    &lt;li&gt;Come to the design surface to :      &lt;ul&gt;       &lt;li&gt;click where to put the shape, &lt;/li&gt;        &lt;li&gt;or to click on a shape and then drag to another shape, or just click a second time on this second shape, to create a relationship &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;And you needed to do start over to 1. for every shape / connector instance you wanted to create. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Alternatively, and for shapes only, you could double click on the corresponding toolbox item, and such a shape would be added to the design surface to a location chosen by the designer itself. This behavior wa&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;&lt;strong&gt;From version for VS2001 Beta1 of the DSL SDK&lt;/strong&gt;&lt;/h3&gt;  &lt;p&gt;From now on, you have the opportunity to choose to enable the &lt;strong&gt;sticky toolbox items&lt;/strong&gt;. If you don’t, you’ll still have the same behaviour as previously.&lt;/p&gt;  &lt;h4&gt;&amp;#160;&lt;strong&gt;How a DSL author enables it:&lt;/strong&gt;&lt;/h4&gt;  &lt;ol&gt;   &lt;li&gt;Having opened the DslDefinition.dsl, go to the DSL Explorer; in the Editor node, you’ll find a new property named “Uses Sticky Toolbox Items”, &lt;/li&gt;    &lt;li&gt;Set “Uses Sticky Toolbox Items” to &lt;strong&gt;true &lt;/strong&gt;(the default is False) &lt;/li&gt;    &lt;li&gt;Transform All Templates &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Stickytoolboxitems_B93B/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/Stickytoolboxitems_B93B/image_thumb_1.png" width="391" height="541" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;What is the behavior for the DSL user:&lt;/strong&gt;&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;Once this behavior is activated, the DSL user will be able to &lt;strong&gt;double-click&lt;/strong&gt; on the items in the toolbox and create as many instances of the shape / connectors as he/she wants. &lt;/li&gt;    &lt;li&gt;In order to leave the sticky toolbox mode, just press the ESC key, or click on the “Selection” tool in the toolbox &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Note that:&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;If the sticky toolbox are activated, the user cannot any longer double-click on a shape in the toolbox to create a single shape as is the case when the sticky toolbox are not activated&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9835490" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>New sample demonstrating the Domain Model Extensibility</title><link>http://blogs.msdn.com/jmprieur/archive/2009/06/27/new-sample-demonstrating-the-domain-model-extensibility.aspx</link><pubDate>Sat, 27 Jun 2009 02:42:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806100</guid><dc:creator>jmprieur</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9806100.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9806100</wfw:commentRss><description>&lt;p&gt;We just published a new sample demonstrating how to extend a DSL after it has shipped.&lt;/p&gt;  &lt;p&gt;The sample presents a DSL to explain the architecture of a multi-Tiered application. Each tier is made of components, which have ports. Connections are made between output ports and input ports. What is new is that a Domain Model Extension will add a “Security Extension” thus providing to the toolbox new items (an Audit Log), to a Tier new decorators, to Ports three new Domain properties related to the HTTP security, new validation methods, and new rules. I’m pretty sure you’ll like this sample very much,&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To learn more about Domain Model extensibility, please go to &lt;a href="http://code.msdn.microsoft.com/DslTools"&gt;http://code.msdn.microsoft.com/DslTools&lt;/a&gt; or click on the following direct links:&lt;/p&gt;  &lt;p&gt;&lt;img alt="Documentation" align="middle" src="https://code.msdn.microsoft.com/Images/Documentation.gif" /&gt; &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=6343"&gt;Domain Model Extensibility -Sample documentation&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;img alt="Source Code" align="middle" src="https://code.msdn.microsoft.com/Images/SourceCode.gif" /&gt; &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=6344"&gt;Domain Model Extensibility -Sample code&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy !&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9806100" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>New Beta1 sample available: ImsLocks.</title><link>http://blogs.msdn.com/jmprieur/archive/2009/06/23/new-beta1-sample-available-imslocks.aspx</link><pubDate>Tue, 23 Jun 2009 10:46:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798986</guid><dc:creator>jmprieur</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9798986.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9798986</wfw:commentRss><description>&lt;p&gt;Today we made a new Beta1 sample available on the Code Gallery (&lt;a title="http://code.msdn.microsoft.com/DslTools" href="http://code.msdn.microsoft.com/DslTools"&gt;http://code.msdn.microsoft.com/DslTools&lt;/a&gt;). This sample, named ImsLocks, explains how a DSL author can prevent the DSL user from editing partially or completely his designer. This can be used for instance to provide a read-only reader for a model, or an annotation/review tool. This also browses you through the new &lt;font face="Courier New"&gt;Microsoft.VisualStudio.Modeling.Immutability&lt;/font&gt; namespace:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/NewBeta1sampleavailableImsLocks_8943/image_3.png" width="1425" height="286" /&gt; &lt;/p&gt;  &lt;p&gt;It’s important to note that:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;In previous versions of the DSL Tools we used to use mainly the Default partition for both the model elements and the presentation elements. This is no longer the case! We now have one partition for the Model elements, and one partition for the presentation elements, thus enabling the finer grain control of the independent locking of presentation as a whole, and model as a whole. This is underlying the IMS Locks DSL Tools feature in Visual Studio 2010 &lt;/li&gt;    &lt;li&gt;now, before any modification to a Model Element or a Presentation Element, the IMS (In Memory Store) Gets and verifies the &lt;strong&gt;Locks&lt;/strong&gt; permissions of the ModelElement / PresentationElement, of the partition it is located in, and of the Store itself. The DSL Author can implement the &lt;strong&gt;ILockingPolicy&lt;/strong&gt; interface to provide a service to refine these locks. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Check out the &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=6282" target="_blank"&gt;documentation&lt;/a&gt; and the &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=6283" target="_blank"&gt;code&lt;/a&gt; to know more about this sample that shows how to make some parts of a model read-only by:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating a CustomLockingPolicy class implementing ILockingPolicy and add it to the services of the DocData&lt;/li&gt;    &lt;li&gt;Creating a means of updating the Locks&lt;/li&gt;    &lt;li&gt;Making use of the locks (to provide useful feedback to the user of the DSL&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9798986" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>A ModelBus sample is now available !</title><link>http://blogs.msdn.com/jmprieur/archive/2009/06/01/a-modelbus-sample-is-now-available.aspx</link><pubDate>Mon, 01 Jun 2009 22:19:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9680510</guid><dc:creator>jmprieur</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9680510.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9680510</wfw:commentRss><description>&lt;p&gt;I’m excited to announce you that we just posted a first DSL SDK 2010 Beta1 sample available from &lt;a href="http://code.msdn.microsoft.com/DslTools"&gt;http://code.msdn.microsoft.com/DslTools&lt;/a&gt;. This sample demonstrates the use of the ModelBus.&lt;/p&gt;  &lt;p&gt;the source code is available here &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=5982"&gt;StateMachineOverModelBus.zip&lt;/a&gt; and its &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=DslTools&amp;amp;DownloadId=5981"&gt;documentation&lt;/a&gt; here.&lt;/p&gt;  &lt;p&gt;Enjoy !&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9680510" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>Announcing the Visual Studio 2010 DSL SDK Beta 1</title><link>http://blogs.msdn.com/jmprieur/archive/2009/05/22/announcing-the-visual-studio-2010-dsl-sdk-beta-1.aspx</link><pubDate>Fri, 22 May 2009 10:59:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9634831</guid><dc:creator>jmprieur</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9634831.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9634831</wfw:commentRss><description>&lt;p&gt;After the &lt;a href="http://blogs.msdn.com/vsxteam/archive/2009/05/21/announcing-the-visual-studio-2010-sdk-beta-1.aspx" target="_blank"&gt;Visual Studio 2010 SDK&lt;/a&gt; announcement yesterday, it’s my turn to be excited to announce the availability, today, of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=390fbb56-4e2c-4585-8f0c-ef51cf4cc93e&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio 2010 DSL SDK Beta1&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;A separate download? Why?&lt;/h3&gt;  &lt;p&gt;Visual Studio 2010 ships with the DSL Tools and T4 runtime in the box in every edition since it is used by other tools in Visual Studio, such as the Linq to SQL designer. The DSL Tools SDK (for the DSL authoring experience) is shipped separately and depends on and exploits features in the Visual Studio SDK. This is the DSL SDK. This is a slight departure from Visual Studio 2008 where DSL Tools authoring shipped inside the VS SDK. Shipping separately gives us more flexibility on when we ship, in particular allows us to make more frequent improvements.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;What is new?&lt;/h3&gt;  &lt;p&gt;In Visual Studio 2010, the F5 experience is improved, and deployment of a DSL considerably simplified, exploiting the extension manager in the Visual Studio platform and the new facilities in the Visual Studio SDK top create a VSIX package which is a simple zip archive that unpacks itself into the User’s extensions folder.    &lt;br /&gt;Visual Studio 2010 Beta1 also brings 11 new DSL features:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Different models can now interact with each other, (and with Visual Studio Team System Architecture UML designers), using the &lt;b&gt;ModelBus&lt;/b&gt;. A DSL author can choose to generate a ModelBus adapter, that will expose his model to other models or tools. &lt;/li&gt;    &lt;li&gt;Databinding support has been added, allowing Windows.Forms and WPF &lt;b&gt;form-based designers&lt;/b&gt; to be created by binding a standard winform or WPF-based UI directly to DSL models. This enables developers to quickly create designers such as the .ResX or .settings designers in Visual Studio. &lt;/li&gt;    &lt;li&gt;It is now possible to have completely or partially &lt;b&gt;read only models&lt;/b&gt;, which can be used for instance by reviewing and commenting tools. &lt;/li&gt;    &lt;li&gt;A number of UI enhancements have been added, including : &lt;/li&gt; &lt;/ol&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;&lt;b&gt;moveable labels&lt;/b&gt; for connectors, &lt;/li&gt;      &lt;li&gt;&lt;b&gt;sticky toolbox&lt;/b&gt; (when the user double-clicks on an item in the toolbox,it’s not necessary to return to the toolbox for repeated applications of the tool), &lt;/li&gt;      &lt;li&gt;quick &lt;b&gt;navigation and editing&lt;/b&gt; of compartments with the keyboard &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Copy and paste&lt;/b&gt; of diagram elements &lt;b&gt;to images&lt;/b&gt; (in Bitmap and .wmf/emf) &lt;/li&gt;      &lt;li&gt;&lt;b&gt;Copy and paste of model elements&lt;/b&gt; in or between diagrams &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;ol&gt;   &lt;li&gt;The notion of &lt;b&gt;DslLibrary&lt;/b&gt; has been introduced. This enables factorizing and componentizing DSLs (for instance having several domain models have the same base-domain class). &lt;i&gt;The authoring for this feature will not be present in Beta1&lt;/i&gt; &lt;/li&gt;    &lt;li&gt;The DSLs can now be extended by third parties after they have deployment. &lt;i&gt;The authoring for this feature will not be present in Beta1&lt;/i&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;br /&gt;A &lt;b&gt;migration tool&lt;/b&gt; is included to help DSL authors migrate there existing DSLs from Visual Studio 2008 and the associated VSSDK. (For more details, see the &lt;a href="http://code.msdn.microsoft.com/DslTools/Release/ProjectReleases.aspx?ReleaseId=2674" target="_blank"&gt;documentation and a video&lt;/a&gt;)   &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Where can I find Samples and Documentation?&lt;/h3&gt;  &lt;p&gt;For samples and Beta 1 documentation, visit the following page on Code Gallery: &lt;a href="http://code.msdn.microsoft.com/DslTools"&gt;http://code.msdn.microsoft.com/DslTools&lt;/a&gt;. There is already the &lt;a href="http://code.msdn.microsoft.com/DslTools/Wiki/View.aspx?title=Read%20Me&amp;amp;referringTitle=Home"&gt;Read Me&lt;/a&gt;, and the online &lt;a href="http://code.msdn.microsoft.com/DslTools/Wiki/View.aspx?title=What%27s%20new&amp;amp;referringTitle=Home"&gt;What's new&lt;/a&gt;. Be also sure to read the information in the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=390fbb56-4e2c-4585-8f0c-ef51cf4cc93e&amp;amp;displaylang=en" target="_blank"&gt;download&lt;/a&gt; page, to help you getting started. We will progressively post samples &lt;a href="http://code.msdn.microsoft.com/DslTools" target="_blank"&gt;there&lt;/a&gt; about the new features, so stay tuned, this is where the information will be available!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You will also have more information visiting the blogs of several members off the DSL Tools team:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/stuart_kent"&gt;http://blogs.msdn.com/stuart_kent&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/garethj"&gt;http://blogs.msdn.com/garethj&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/eyal"&gt;http://blogs.microsoft.co.il/blogs/eyal&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/jmprieur"&gt;http://blogs.msdn.com/jmprieur&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I wish you to enjoy this Beta1 as much as we enjoyed building it&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9634831" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>Another T4 editor, by Tangible Engineering</title><link>http://blogs.msdn.com/jmprieur/archive/2009/04/16/another-t4-editor-by-tangible-engineering.aspx</link><pubDate>Thu, 16 Apr 2009 23:48:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9553482</guid><dc:creator>jmprieur</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/9553482.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=9553482</wfw:commentRss><description>&lt;p&gt;Until now, I have been using &lt;a href="http://www.visualt4.com/home.html" target="_blank"&gt;Clarius’s T4 editor&lt;/a&gt;. However, &lt;a href="http://www.olegsych.com/2009/04/t4-editor-by-tangible-engineering/" target="_blank"&gt;Oleg&lt;/a&gt; recently wrote a post where he presents an overview of a new T4 editor he has been using:&lt;a href="http://t4-editor.tangible-engineering.com/T4-Editor-Visual-T4-Editing.html" target="_blank"&gt;Tangible engineering’s T4 editor&lt;/a&gt;. I did not have time to download it, busy as we are preparing the Beta1 of Visual Studio, but this is definitively something I want to do …&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553482" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSTS2010/default.aspx">VSTS2010</category></item><item><title>[DSL Tools] Reference relationships and compartment shapes</title><link>http://blogs.msdn.com/jmprieur/archive/2008/08/30/dsl-tools-reference-relationships-and-compartment-shapes.aspx</link><pubDate>Sat, 30 Aug 2008 07:33:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8908276</guid><dc:creator>jmprieur</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jmprieur/comments/8908276.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jmprieur/commentrss.aspx?PostID=8908276</wfw:commentRss><description>&lt;h3&gt;Presentation of the problem: &lt;/h3&gt; &lt;h4&gt;Deleting behaviour with compartments representing embeddings&lt;/h4&gt; &lt;p&gt;Most of the time, in the DSL Tools, you map compartments in compartment shapes to embedding relationships. &lt;/p&gt; &lt;p&gt;And then, deleting a compartment item in the compartment shape indeed removes the model element which was displayed as this compartment item, which makes sense.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;Deleting behaviour with compartments representing reference relationships&lt;/h4&gt; &lt;p&gt;Now let's suppose you have are mapping a compartment not to an embedding, but to a reference relationship. You might think that deleting a compartment item will only delete the link between the instance represented by the compartment shape and the instance represented by the compartment item. But it turns out that it also deletes the instance represented by the compartment item.&lt;/p&gt; &lt;p&gt;There are &lt;a href="http://forums.msdn.microsoft.com/en/vsx/thread/faf2852f-a363-4dc1-be3c-36df4a065ef8" target="_blank"&gt;scenarios&lt;/a&gt;, where you would like first behaviour. This posts explains why it is so, and how to proceed to have only the link deleted, not the target model element.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;A case study: what it does, and what we would want&lt;/h3&gt; &lt;h4&gt;The domain model&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;we have 2 domain classes &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; and &lt;font face="Courier New"&gt;ClassB&lt;/font&gt;, linked thru a Reference relationship (many-many) named &lt;font face="Courier New"&gt;ClassAReferencesClassB&lt;/font&gt;  &lt;li&gt;&lt;font face="Courier New"&gt;ClassB &lt;/font&gt;is represented as a geometric shape &lt;font face="Courier New"&gt;ClassBShape&lt;/font&gt;  &lt;li&gt;&lt;font face="Courier New"&gt;ClassB &lt;/font&gt;is represented by a compartment shape &lt;font face="Courier New"&gt;ClassAShape&lt;/font&gt;, which displays the &lt;font face="Courier New"&gt;ClassB&lt;em&gt;s&lt;/em&gt; &lt;/font&gt;referenced by the instance of &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; through &lt;font face="Courier New"&gt;ClassAReferencesClassB&lt;/font&gt;  &lt;li&gt;the same &lt;font face="Courier New"&gt;ClassAReferencesClassB &lt;/font&gt;is also represented by a connector, so that we really see what is happening there.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_8.png" target="_blank"&gt;&lt;img height="280" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_3.png" width="640"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Figure 1: the domain model (please, click the image to enlarge)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Opening the &lt;strong&gt;DSL Details&lt;/strong&gt; tool window, and clicking on the mapping line between &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; and &lt;font face="Courier New"&gt;ClassAShape&lt;/font&gt;, in the &lt;strong&gt;Compartment Maps&lt;/strong&gt; tab, we use the path editor as we usually do and end-up with the following, which really means that in the Bs compartment, we are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;requesting to represent ClassB instances, which we get though the ClassAReferencesClassB relationship navigating though the ClassB role (Displayed elements collection path)  &lt;li&gt;Then we want to display the Name of each ClassB (Display property).&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="308" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_2.png" width="660" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Figure 2: The mapping between ClassA and the compartment shape representing it.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;&lt;/h3&gt; &lt;h4&gt;Running our designer - what it does&lt;/h4&gt; &lt;p&gt;After transforming all templates, and running the editor, you create a &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; , a &lt;font face="Courier New"&gt;ClassB&lt;/font&gt; , and connect them through the connector, in order to get this (the ClassB1 instance also appears in the compartment, since the relationship is mapped both to the compartment and the connector)&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_4.png" width="801" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Figure 3: Running our designer - starting point&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now, let's try to delete ClassB1 from the compartment (Using the Del key or the contextual Delete command). You end-up with this:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;the ClassB1 represented instance was deleted (after all the Delete command was targeting it), removing the link, of course  &lt;li&gt;consequently the ClassB1 shape was deleted&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_14.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="335" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_6.png" width="812" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Figure 3: Running our designer&amp;nbsp; - what Delete does on the compartment item&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;Running our designer - What we would like&lt;/h4&gt; &lt;p&gt;That said. You were maybe expecting that, considering you were using a Reference relationship and not an embedding, you would end-up with only deleting the link between ClassA1 and ClassB1 and not the ClassB1 instance. It turns out that this scenario is of interest, but this is not what you requested. You really sent the Delete command to the ClassB1 instance, hence the result.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h3&gt;How to get what we want&lt;/h3&gt; &lt;p&gt;In fact, to tell you the truth, I thought myself this behaviour was a bug :-), until &lt;a href="http://blogs.msdn.com/stuart_kent" target="_blank"&gt;Stuart&lt;/a&gt; explained me about the command being directed to the &lt;font face="Courier New"&gt;ClassB&lt;/font&gt;s instances and not to the link. Then, you can very easily achieve our desired behaviour specifying the right things in the DSL Details window on the shape map (and not writing any custom code)&lt;/p&gt; &lt;p&gt;Here is how we should proceed.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Still in the Compartment Maps tab of our mapping between &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; and &lt;font face="Courier New"&gt;ClassAShape&lt;/font&gt;, we need to express that we want to deal not with &lt;font face="Courier New"&gt;ClassB&lt;/font&gt; instances but with a collection of &lt;font face="Courier New"&gt;ClassAReferencesClassB&lt;/font&gt;links form the instance of &lt;font face="Courier New"&gt;ClassA&lt;/font&gt; represented by the compartment shape to the related &lt;font face="Courier New"&gt;ClassB&lt;/font&gt; instances. &lt;br&gt;&lt;br&gt;The &lt;strong&gt;Displayed elements collection path&lt;/strong&gt; should, therefore be &lt;font face="Courier New" color="#0000ff"&gt;ClassAReferencesClassB.ClassB&lt;/font&gt; &lt;br&gt;This can be understood as the same code construct as &lt;font face="Courier New"&gt;ClassAReferencesClassB.GetLinksToClassB(ClassA1)&lt;/font&gt; which returns &lt;strong&gt;collection of ClassAReferencesClassB&lt;/strong&gt;. This is really an instance of the link that will be presented as a compartment item, and thus, deleting it will delete the link, not the targeted ClassB.&lt;br&gt; &lt;li&gt;Now, we need to specify what to display (namely the Name property of the ClassB instance accessed through the link). For that, given an instance of &lt;font face="Courier New"&gt;ClassAReferencesClassB&lt;/font&gt;, we need to get an instance of &lt;font face="Courier New"&gt;ClassB&lt;/font&gt; (just in order to access its property). We express this in the &lt;strong&gt;Path to display property&lt;/strong&gt; field as &lt;font face="Courier New" color="#0000ff"&gt;ClassAReferencesClassB!ClassB&lt;font face="Trebuchet MS"&gt;&lt;font color="#000000"&gt; which means getting the ClassB property of the &lt;font face="Courier New"&gt;ClassAReferencesClassB &lt;/font&gt;&lt;/font&gt;&lt;font face="Trebuchet MS" color="#000000"&gt;instance, that is getting a &lt;font face="Courier New"&gt;ClassB&lt;/font&gt; instance.&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;li&gt;The last step is to provide the &lt;strong&gt;Display property&lt;/strong&gt;, here Name&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="296" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_8.png" width="718" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Figure 4: how to express we want to deal with links&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;Running our designer - We get what we want&lt;/h4&gt; &lt;p&gt;After transforming all templates, and running the designer the first thing is you get exactly the same appearance as before (even if now the compartment items represent links and not model element instances). This is no surprise because we did all we could for that, but it's work noting it&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="306" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_4.png" width="801" border="0"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Figure 5: Running our new designer - apparently this is like before&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;But this, time, deleting the ClassB1 compartment item, we end up with the following expected result:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_16.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="338" alt="image" src="http://blogs.msdn.com/blogfiles/jmprieur/WindowsLiveWriter/DSLToolsReferencerelationshipsandcompart_113D4/image_thumb_7.png" width="810" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Figure 6: Running our new designer - the delete command now delete the link, not the targeted shape&lt;/p&gt; &lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;h2&gt;Conclusion&lt;/h2&gt; &lt;p&gt;In this post, we learnt why, when mapping a compartment to a reference relationship, deleting compartment items deletes the targeted model element with the usual mapping, and how to change the mapping so that it only deletes the link.&lt;/p&gt; &lt;p&gt;To get more information about the path syntax, you can review &lt;a href="http://msdn.microsoft.com/en-us/library/bb126479(VS.80).aspx " target="_blank"&gt;Overview of Domain Path Syntax&lt;/a&gt; . When I started with the DSL tools, I also found this &lt;a href="http://forums.msdn.microsoft.com/en/vsx/thread/27c115ea-b337-4c9e-b74e-56cc7dbb4c0d" target="_blank"&gt;post&lt;/a&gt; by Alan very useful. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8908276" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jmprieur/archive/tags/VSX/default.aspx">VSX</category><category domain="http://blogs.msdn.com/jmprieur/archive/tags/DSL+Tools/default.aspx">DSL Tools</category></item></channel></rss>