<?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>5ise &#187; DSL</title>
	<atom:link href="http://5ise.quanxinquanyi.de/category/dsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://5ise.quanxinquanyi.de</link>
	<description>Andreas Graf&#039;s Software Engineering Blog</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:56:38 +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>Integrating the AUTOSAR tool chain with Eclipse based model transformations</title>
		<link>http://5ise.quanxinquanyi.de/2010/08/31/integrating-the-autosar-tool-chain-with-eclipse-based-model-transformations/</link>
		<comments>http://5ise.quanxinquanyi.de/2010/08/31/integrating-the-autosar-tool-chain-with-eclipse-based-model-transformations/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 15:00:24 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Automotive]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=370</guid>
		<description><![CDATA[Integrating the AUTOSAR tool chain with Eclipse based model transformations Andreas Graf1,Markus Völter2 1: itemis GmbH, Blücherstr. 32, 75177 Pforzheim, Germany 2: independent/itemis GmbH, Hohnerstr. 25, 70469 Stuttgart, Germany This paper has been presented and published at ERTS2 2010 Extended Abstract for Application: Keywords: AUTOSAR, Eclipse, Open Source, model transformation, Artop, Model Driven Engineering, AUTOSAR [...]]]></description>
			<content:encoded><![CDATA[<h1>Integrating the AUTOSAR tool chain with Eclipse based model transformations</h1>
<p>Andreas Graf<sup>1</sup>,Markus Völter<sup>2</sup> <sup> </sup> <sup> </sup></p>
<p>1: itemis GmbH, Blücherstr. 32, 75177 Pforzheim, Germany</p>
<p>2: independent/itemis GmbH, Hohnerstr. 25, 70469 Stuttgart, Germany</p>
<p><strong>This paper has been presented and published at ERTS2 2010<br />
</strong></p>
<p><strong>Extended Abstract for Application</strong>: <strong> </strong></p>
<p><strong>Keywords</strong>: AUTOSAR, Eclipse, Open Source, model transformation, Artop, Model Driven Engineering, AUTOSAR tool chain, software development process, AUTOSAR migration, automotive software, standardization, Engineering tools integration and interoperability, Open source, open systems. <strong> </strong></p>
<p>1. Introduction</p>
<p>AUTOSAR is establishing itself as a prominent standard in automotive systems and is expected to significantly improve software architecture and the software development processes. However, the introduction of AUTOSAR also poses some challenges.</p>
<p>AUTOSAR only defines part of the development process, it does not specify how to interface tools in preceding process steps (such as functional design or requirements engineering) and to subsequent steps (such as testing or the actual implementation of the software).</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h47_53.png"><img class="aligncenter size-full wp-image-377" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h47_53.png" alt="" width="800" height="227" /></a></p>
<p>In addition, AUTOSAR currently does not cover all aspects of automotive software. AUTOSAR software needs to communicate with non-AUTOSAR software, for example in the infotainment domain or even with off-board software.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/dum1.gif"><br />
</a></p>
<p>In addition to these conceptual challenges, the availability of tools can be a challenge, too. Similar to the early phase of UML, AUTOSAR tools are rather new and immature, and experience with those tools is not widespread. Tool features might be lacking and the integration of AUTOSAR tools into a company’s overall tool chain will definitely not be provided out of the box by an off-the-shelf tool. It needs customization.</p>
<p>The different steps in the AUTOSAR methodology might be addressed by different AUTOSAR tools from different vendors. Those tools need to interact with each other, increasing increases the need for an open approach that allows for customization and extension.</p>
<p>2. Scope of the paper</p>
<p>In this paper, we discuss a number of examples of the challenges above. The paper shows how these challenges can be alleviated by Eclipse based tools.</p>
<p>Eclipse has established itself as an industrial strength development tool in industries that develop complex systems, such as aerospace and automotive. OEMs, first-tiers and suppliers already successfully use it for software development and as a rich and mature tooling platform. It can be seen as a platform for domain specific extensions that can be used out-of-the box (e.g. the C programming IDE “CDT”) as well as a platform for additional tools.</p>
<p>The open nature of the Eclipse platform allows for the integration of applications and project specific extensions.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h49_39.png"><img class="aligncenter size-full wp-image-378" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h49_39.png" alt="" width="821" height="422" /></a></p>
<p>With Eclipse’s latest Galileo release, several mature tools for model-driven software development (MDSD) have become available. These provide a flexible and low-cost set of tools for bridging the gaps in existing AUTOSAR tool chains.</p>
<p>The paper is structured as follows: We first introduce the AUTOSAR tool platform Artop and a number of open source Eclipse Modeling tools and explain their role in model driven development. We then show example challenges in the integration of an AUTOSAR tool chain and sketch solutions for these challenges based on the Eclipse based tools introduced.</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>3. Tools</strong></p>
<p>In this paper, we look at Eclipse-based tools for model-driven software development. Eclipse is an open source project started by IBM a couple of years ago. Initially Eclipse was a Java development environment. However, from the start, Eclipse has been architected to be extendable in significant ways. Over time, a number of additional projects have been initiated as part of the Eclipse platform; among them the Eclipse Modeling project.</p>
<p>The Eclipse Modeling project is a collection of frameworks and tools for model driven development. In sum, they provide a wide range of solutions for various aspects of model driven development, from language definition to editor construction to code generation as well as model verification and validation.</p>
<p>This section introduces some of the tools from Eclipse Modeling. Specifically, we suggest those tools as a basis for integrating an AUTOSAR tool chain.</p>
<h2>EMF</h2>
<p>EMF, the Eclipse Modeling Framework, forms the basis for all Eclipse Modeling tools. At its core, it provides the Ecore meta meta  model, a formalism for defining the abstract syntax of modeling languages. EMF comes with a set of related frameworks and tools for validation, query, persistence, and model transactions.</p>
<h2>Xpand</h2>
<p>Xpand is a framework for code generation (in fact, you can generate any kind of textual artifact such as configuration files or documentation as well). It processes models based on languages defined with EMF. The Xpand language itself is quite sophisticated in the sense that it contains a powerful expression language for querying and traversing models. It also supports polymorphism and aspects for code generation templates, making sure that nontrivial code generators remain maintainable.</p>
<h2>Xtend</h2>
<p>Xtend is used for transforming models into other models, for modifying existing models before they are fed into a code generator, as well as for implementing simple helper functions that are used as part of code generation templates.</p>
<h2>Check</h2>
<p>Check is used for validating models. Constraints are expressed in the constraints Check language (which embeds the same OCL-like expression language used in Xpand and Xtend). The constraints are then evaluated either in real time in the editors when creating models or as part of model transformation and code generation workflows.</p>
<h2>Xtext</h2>
<p>Xtext is a framework for defining textual domain specific languages. Based on a grammar definition, the Xtext tooling generates a parser, an EMF meta-model, as well as an editor for the language defined by the grammar. The editor provides all the features known from current IDE&#8217;s: code completion, syntax highlighting, folding, customizable outline views, go-to definition and find references, etc. Using Xtext, the effort of defining languages and providing editor support on a level that makes using that language productive and comfortable becomes significantly simpler.</p>
<h2>GMF</h2>
<p>GMF supports the construction of graphical editors (box and line style) for existing EMF meta-models. Using this framework, you can define graphical notations for your own languages.</p>
<h2>Integration of the tools</h2>
<p>Using the above mentioned tools together results in a complete toolset for model driven development. You define your meta-models using EMF, then you add a graphical or textual notation using GMF or Xtext, you use check for validating models, and finally, you can use Xtend and Xpand to transform the models created with your graphical or textual editors into other models or text.</p>
<p>An additional project, the modeling workflow engine, is used to orchestrate the processing of models. It provides facilities for loading models from files and supplying them to validation, transformation, and code generation components.</p>
<h2>Artop</h2>
<p>One of the fundamental motivations of AUTOSAR is to increase the reuse of software within the car. Transferring this motivation to the AUTOSAR authoring tools is a logical step. This motivation drives the Artop initiative.</p>
<p>The AUTOSAR Tool Platform (Artop) is an implementation of common base functionality for AUTOSAR development tools. Artop uses many of the above mentioned frameworks to provide specific base functionalities for creating AUTOSAR tools. This includes a complete implementation of the AUTOSAR meta-model in the form of an Ecore model, an extensible validation engine for checking AUTOSAR specific and even project-specific constraints, a sophisticated workspace management that takes into account AUTOSAR’s way of storing models and lots more.</p>
<p>Artop is developed by the Artop User Group, a group of AUTOSAR members and partners and uses Eclipse not only as its technical platform but also uses a similar community approach to develop the software. Artop is open to any AUTOSAR member or partner.</p>
<h2>Sphinx</h2>
<p>The Sphinx project proposal [Sph2010] is a proposal for a new Eclipse Model Development Tools (MDT) subproject.</p>
<p>While developing Artop a lot of functionalities were developed, that had their origins in the use of AUTOSAR, but were not specific to AUTOSAR at all. Similar functionalities were also required in other industries than the automotive domain, like avionics.</p>
<p>The goal of the Sphinx proposal is to remove these features from the Artop platform and rather develop them in a larger community within the Sphinx project.</p>
<h1>4. Bridging the gaps</h1>
<p>Based on these tools, there are two basic types of tool integration: A tight integration on the Eclipse platform and a looser coupling through data exchange formats.</p>
<p>The tight integration allows tools that conform to the Eclipse architecture to be integrated within one application. The user does not have to switch between different applications, because he sees an integrated development environment.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h50_53.png"><img class="aligncenter size-full wp-image-379" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h50_53.png" alt="" width="826" height="431" /></a></p>
<p>However, existing tools used by projects might not be based on Eclipse. By making use of the Eclipse modeling tools, a loose integration is still possible through data import and export.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h51_51.png"><img class="aligncenter size-full wp-image-380" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h51_51.png" alt="" width="918" height="423" /></a></p>
<h1>5. Challenges and Solutions</h1>
<p>In this section we show how to use the aforementioned tools to address a number of challenges in the integration of an AUTOSAR tool chain.</p>
<p>To describe the relevant AUTOSAR models, we will introduce a textual description of AUTOSAR models called ARText. ARText is based on Xtext and an early implementation is available through the Artop distribution. This language is used to illustrate AUTOSAR models used in the examples, since it is much more concise than a graphical notation. Here is an example of a definition of a sensor component with an interface in ARText format:</p>
<p><strong>interface</strong> <strong>senderReceiver</strong> cardata {</p>
<p><strong>data</strong> int32 speed</p>
<p>}</p>
<p><strong>component</strong> <strong>atomic</strong> Sensor {</p>
<p><strong>ports</strong> {</p>
<p><strong>sender</strong> X <strong>provides</strong> cardata</p>
<p>}</p>
<p>}</p>
<p>Model-to-Model-Transformations and Model-to-Text-Transformations are shown as examples in the solutions to the challenges. The code fragments of the transformation are for illustration only. Real transformations might include additional code.</p>
<p><strong>Adding AUTOSAR Import / Export to existing tools</strong></p>
<p>Challenge: All tools within the AUTOSAR tool chain have to be able to read / write data in the AUTOSAR XML format. The AUTOSAR XML-format is a complex data exchange format. Adding reading / writing functionality to an existing application requires significant effort. If every tool re-implements the XML functionality, the end user basically pays several times for the development of a non-differentiating feature. The cost and time can be significantly reused by making use of Artop and the Eclipse modeling tools.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h53_00.png"><img class="aligncenter size-full wp-image-381" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h53_00.png" alt="" width="954" height="595" /></a></p>
<p>Figure 1 – XML Readers and Writers are a redundant functionality in the tool chain.</p>
<p>Solution: Artop provides capabilities to read and write the AUTOSAR XML formats to and from the Eclipse EMF. Using model transformations, AUTOSAR models can be converted to the native format of existing tools.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h53_41.png"><img class="aligncenter size-full wp-image-382" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h53_41.png" alt="" width="793" height="203" /></a></p>
<p>Figure 2 – Integrating non-AUTOSAR tools by model transformation</p>
<p>For the example, a transformation of the AUTOSAR model into a CSV (Comma-Separated-Value)-file is given. CSV is a common file format that can be read by various spread sheet and database tools. Each line of the output should contain a software component name and information about the ports of that software component. A Xpand template could be similar to the template shown in Fragment 1.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h55_46.png"><img class="aligncenter size-full wp-image-383" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h55_46.png" alt="" width="583" height="452" /></a></p>
<p>Code Fragment 1 – M2T of AUTOSAR into .csv</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h56_18.png"><img class="aligncenter size-full wp-image-384" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h56_18.png" alt="" width="544" height="78" /></a></p>
<p>Code Fragment 2 – CSV Result</p>
<p><strong> </strong></p>
<p>The first line of the output file contains the component of the short example given in the introduction with the specification of the provided part. The second line shows an additional software component to illustrate the structure of the output file. Any output file in a textual format can be generated by Xpand.<strong> </strong></p>
<p><strong> </strong></p>
<p><strong>Integration of </strong><strong>Behavioral</strong><strong> Models</strong></p>
<p>Challenge: AUTOSAR explicitly provides no means for the specification of the behavior (program logic) of software. In model bases software development, a number of modeling approaches are well established (such as state machines or dataflow modeling). However, AUTOSAR does not specify a mapping to behavioral modeling paradigms. The linking and synchronization between with artifacts in other modeling tools is not defined.</p>
<p>Solution: Use model transformations to synchronize the AUTOSAR model with a behavioral model. This helps to avoid redundant modeling of elements in more than one tool and manual synchronization. The exemplary solution links AUTOSAR models with UML state machines.</p>
<p>The meta-model elements of AUTOSAR and the state machine have to be mapped. A state machine needs to react to data being received. For this solution, we map AUTOSAR data elements to state machine triggers. Based on this mapping, a model-to-model-transformation generates the skeleton of a state machine and infers the required events / triggers from the AUTOSAR specification.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h56_47.png"><img class="aligncenter size-full wp-image-385" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h56_47.png" alt="" width="539" height="251" /></a></p>
<p>Code Fragment 3 – M2M of AUTOSAR into UML state machines</p>
<p>The code fragment generates a state machine for every software component and to keep the models synchronized, adds a trigger for each data element of required interfaces (i.e. incoming data).</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h57_23.png"><img class="aligncenter size-full wp-image-386" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h57_23.png" alt="" width="518" height="328" /></a></p>
<p>Figure 3 &#8211; AUTOSAR Data Element as triggers in state machines</p>
<p><strong>Comfortable Editing of Large models</strong></p>
<p>Challenge: Creating complex models with graphical modeling tools often is a time-consuming task, since the creation of new model elements involve a lot of mouse movements and switching between keyboard and mouse.</p>
<p>Solution: Textual domain specific languages are an established approach to create a user-friendly modeling environment. A comfortable environment with syntax highlighting, code completion and navigation functionality allows the user to quickly create models without the need for time-consuming context switches between mouse and keyboard  [ARText2009]. Additionally, textual formats successfully scale to large projects and are also suited to distributed development environments. This is due to the format taking advantage of the well established textual tools and infrastructure supporting this environment. For example, configuration, source, change and version control. Support for these functions is integral for an effective distributed development environment.</p>
<p>With ARText the Artop community provides an environment for textual languages based on AUTOSAR. It defines and implements a textual language to describe AUTOSAR models. The framework is based upon Xtext which gives access to rich features for textual languages like syntax-highlighting and code-completion. The textual notation used in this document is the ARText notation.</p>
<p>Developers who are more inclined to textual formats will benefit from a less steep learning curve when developing AUTOSAR models with ARText.</p>
<p><strong>Project Specific Code generation</strong></p>
<p>Challenge: Existing tools might not be prepared for AUTOSAR-conforming code generation. Manual post processing of the code is necessary.</p>
<p>Solution: Create AUTOSAR conforming code by using customized generation templates based on Xpand.</p>
<p>For the exemplary integration of open-source state machine modeling / simulation, the Yakindu tool generation has been made AUTOSAR conforming.</p>
<p>The state machine for terminal control</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h57_59.png"><img class="aligncenter size-full wp-image-387" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h57_59.png" alt="" width="540" height="379" /></a></p>
<p>Figure 4 &#8211; State Machine as input to the generation.</p>
<p>can be transformed into AUTOSAR compliant code that uses the RTE as an interface to get notified of incoming transition triggers and reacts by sending data through the RTE.</p>
<p><strong>Migrating Legacy Models to AUTOSAR</strong></p>
<p>Challenge: Migrate existing component models to AUTOSAR. Before the introduction of AUTOSAR, projects often modeled the software architecture with other notations (e.g. UML). These models have to be migrated to AUTOSAR.</p>
<p>Solution: Load the models into Eclipse and transform them to AUTOSAR. Most UML2 should have a XMI-conforming export. These models are loaded into a UML2-EMF model and subsequently transformed to Artop models directly by Xtend or to textual representations like ARText.</p>
<p>Suppose that every class in a UML model should be transformed into an AUTOSAR software component. The following Xtend transformation will perform this transformation.</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h58_36.png"><img class="aligncenter size-full wp-image-388" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h58_36.png" alt="" width="547" height="303" /></a></p>
<p>Code Fragment 4 – M2M of UML to AUTOSAR</p>
<p>The second create function will create an AUTOSAR package in the destination model and call the transformation for every class in the UML model. The semantics of the class to component transformation is specified in the third create statement. Here it is a simply copying of the name.</p>
<p><strong>Generating RTE for non-AUTOSAR Basic SW</strong></p>
<p>Challenge: Implement an AUTOSAR RTE on platforms that have no AUTOSAR Basic Software available. One of the suggested migration strategies to AUTOSAR ECUs is the use of legacy BSW with AUTOSAR conforming application layer as a first step [AR2010]. However, COTS RTE generators cannot be used, since they usually do not support project specific legacy basic software.</p>
<p>Solution: Use Xpand to generate a RTE that conforms the API for the application software and interfaces to the platform specific basic software. Supposing, that a communication call in the legacy software would have the signature “void Legacy_SendCall(…)”, a RTE that makes use of this generation can be generated by a code fragment like:</p>
<p><a href="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h59_21.png"><img class="aligncenter size-full wp-image-389" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/08/2010-08-31-16h59_21.png" alt="" width="550" height="426" /></a></p>
<p>Code Fragment 5 – M2M of UML to AUTOSAR</p>
<h1>6. Conclusion</h1>
<p>In the paper we showed some of today’s recurrent challenges in tools and described the need for more integrated tool chains. Challenges in the integration of an AUTOSAR tool chain can be solved by the use of inexpensive Eclipse based tooling. An open platform is the precondition for an integrated tool chain. The solutions shown in this paper have been applied in various projects.</p>
<p>4. References:</p>
<p>[Sph2010] Sphinx project proposal, <a href="http://www.eclipse.org/proposals/sphinx/" onclick="pageTracker._trackPageview('/outgoing/www.eclipse.org/proposals/sphinx/?referer=');">http://www.eclipse.org/proposals/sphinx/</a></p>
<p>[ARText2009] S. Benz, D. Wong. “ARText &#8211; Driving Developments with Xtext“, http://www.slideshare.net/sebastianbenz/artext-driving-developments-with-xtext<strong> </strong></p>
<p>[AR2010] S. Fürst et al., “AUTOSAR – Migration and Advantages of an Industry-Wide Standard“. Proceedings of the VDA technical Congress 2010</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2010/08/31/integrating-the-autosar-tool-chain-with-eclipse-based-model-transformations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Natural Language and DSLs</title>
		<link>http://5ise.quanxinquanyi.de/2010/07/07/natual-language-and-dsls/</link>
		<comments>http://5ise.quanxinquanyi.de/2010/07/07/natual-language-and-dsls/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:26:30 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[PMT-Processes,Methods,Tools]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=303</guid>
		<description><![CDATA[A year ago I had blogged about Inform 7, an interesting DSL for the implementation of interactive fiction. I had briefly explored it, but didn&#8217;t do much more, because some of the concepts made it hard to use for my purposes (e.g. &#8220;relations&#8221; could only be defined between instances of objects, not classes. So you [...]]]></description>
			<content:encoded><![CDATA[<p>A year ago I had blogged about <a href="http://inform7.com/" onclick="pageTracker._trackPageview('/outgoing/inform7.com/?referer=');">Inform 7</a>, an interesting DSL for the implementation of interactive fiction. I had briefly explored it, but didn&#8217;t do much more, because some of the concepts made it hard to use for my purposes (e.g. &#8220;relations&#8221; could only be defined between instances of objects, not classes. So you needed a lot of workarounds). However, just recently the developers released a new version that removes several limitations.</p>
<p>I happen to come back to look at the DSL, if only for inspiration on how you can find notations that seem natural and yet are formal.  Inform 7</p>
<ul>
<li>wants describe a &#8220;world&#8221; in an executable way</li>
<li>expects its users to be literary inclined, not programming geeks.</li>
</ul>
<p>These goals are obviously similar to the use of DSLs. An example of how a description of a physical system could look like can be found in the examples:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">&quot;Lead Cuts Paper&quot;
&nbsp;
A weight is a kind of value. 10kg specifies a weight. Everything has a weight. A thing usually has weight 1kg.
&nbsp;
A container has a weight called breaking strain. The breaking strain of a container is usually 50kg. Definition: A container is bursting if the total weight of things in it is greater than its breaking strain.
&nbsp;
A lead pig, a feather, a silver coin and a paper bag are in a room called the Metallurgy Workshop. The paper bag is a container with breaking strain 2kg.  The lead pig has weight 50kg.
&nbsp;
Every turn when a container (called the sack) held by someone visible (called the chump) is bursting:
 say &quot;[The sack] splits and breaks under the weight! [if the player is the chump]You discard[otherwise][The chump] discards[end if] its ruined remains, looking miserably down at [the list of things in the sack] on the floor.&quot;;
 now all of the things in the sack are in the location;
 remove the sack from play.</pre></td></tr></table></div>

<p>Especially the first three lines show how a physical system with rules can be described in (almost) natural language. And it can actually be executed. This is a transcript of the session:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Lead Cuts Paper
An Interactive Fiction
Release 1 / Serial number 100707 / Inform 7 build 6E72 (I6/v6.31 lib 6/12N) SD
&nbsp;
Metallurgy Workshop
You can see a lead pig, a feather, a silver coin and a paper bag (empty) here.
&nbsp;
&gt;get pig
Taken.
&nbsp;
&gt;get bag
Taken.
&nbsp;
&gt;put pig into bag
You put the lead pig into the paper bag.
&nbsp;
The paper bag splits and breaks under the weight! You discard its ruined remains, looking miserably down at the lead pig on the floor.</pre></div></div>

<p>Of course, we&#8217;d probably not describe lead pigs put components of cars and satellites &#8230;.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Another interesting feature is the specification of tabular data. Again from the docs:</p>
<p><a href="pasteCode37()"><img src="../doc_images/paste.png" border="0" alt="" /></a> Table 2.1 &#8211; Selected Elements</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top"><span style="color: #000080;font-size: x-small">Element</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">Symbol</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">Atomic number</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">Atomic weight</span></td>
</tr>
<tr>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Hydrogen&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;H&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">1</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">1</span></td>
</tr>
<tr>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Iron&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Fe&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">26</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">56</span></td>
</tr>
<tr>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Zinc&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Zn&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">30</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">65</span></td>
</tr>
<tr>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;Uranium&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">&#8220;U&#8221;</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">92</span></td>
<td valign="top"><span style="color: #000080;font-size: x-small">238</span></td>
</tr>
</tbody>
</table>
<p>And the access to the table:</p>
<p><span><span style="color: #000080">symbol in row 3 of the Table of Selected Elements </span></span></p>
<p><span><span> </span></span>It will be interesting to see, if notations like this will establish themselves more and more.</p>
<p><span><span style="color: #000080"> </span></span></p>
<p><a href="pasteCode37()"><img src="../doc_images/paste.png" border="0" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2010/07/07/natual-language-and-dsls/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xtext, BNF, Marte and MSCs</title>
		<link>http://5ise.quanxinquanyi.de/2010/03/12/xtext-bnf-marte-and-mscs/</link>
		<comments>http://5ise.quanxinquanyi.de/2010/03/12/xtext-bnf-marte-and-mscs/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 11:24:29 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=193</guid>
		<description><![CDATA[Currently we are doing some work on the specification of non-functional properties (such as timing) in the ITEA2 VERDE project. In VERDE, the UML profile MARTE plays a major role. MARTE has a BNF-based Value Specification Language that can be used to specify, amongst other things, timing like The VSL is specified in typical BNF [...]]]></description>
			<content:encoded><![CDATA[<p>Currently we are doing some work on the specification of non-functional properties (such as timing) in the ITEA2 VERDE project. In VERDE, the UML profile MARTE plays a major role. MARTE has a BNF-based Value Specification Language that can be used to specify, amongst other things, timing like The VSL is specified in typical BNF notation</p>
<p>&lt;value-specification&gt; ::= &lt;literal&gt; | &lt;enum-specification&gt; | &lt;interval&gt; |<br />
&lt;collection&gt; | &lt;tuple&gt; | &lt;choice&gt; | &lt;expression&gt; |<br />
&lt;time-expression&gt; | &lt;obs-call-expression&gt;</p>
<p>Creating a Xtext grammar is very easy, but re-typing and manually transforming from BNF to Xtext is boring. Obviously, with a Xtext grammar for BNF, we could easily transform the MARTE BNF into a MARTE Xtext grammar and work with that. The first shot is a grammar like</p>
<p>grammar de.itemis.verde.Bnf with org.eclipse.xtext.common.Terminals</p>
<p>generate bnf &#8220;http://www.itemis.de/verde/Bnf&#8221;</p>
<p>Model:<br />
(rules+=Rule)*;</p>
<p>Rule : &#8220;&lt;&#8221;name=RULENAME&#8221;&gt;&#8221; &#8220;::=&#8221; e=Expression ;</p>
<p>Expression :<br />
el+=OredElement (&#8220;|&#8221; el+=OredElement)*;</p>
<p>OredElement:<br />
(terms+=Term)+;</p>
<p>//LineEnd: EOL+;</p>
<p>//List: Term | (t=Term l=List);</p>
<p>Term: o=OptionalExp | l=ListExp | k=KeyConstr | r=RuleCall;</p>
<p>OptionalExp:Â Â Â  &#8220;[" x=Expression "]&#8221; (mult?=&#8221;*&#8221;)?;<br />
ListExp:Â  &#8220;(&#8221; x=Expression &#8220;)&#8221; (plus?=&#8221;+&#8221;)? (mult?=&#8221;*&#8221;)? ;<br />
KeyConstr:Â  k+=Keyword (&#8220;..&#8221; k+=Keyword)? ;</p>
<p>Keyword:<br />
text=STRING;</p>
<p>RuleCall:<br />
&#8220;&lt;&#8221;ref=[Rule|RULENAME]&#8220;&gt;&#8221;;</p>
<p>terminal RULENAME : (&#8216;a&#8217;..&#8217;z'|&#8217;A&#8217;..&#8217;Z'|&#8217;-') (&#8216;a&#8217;..&#8217;z'|&#8217;A&#8217;..&#8217;Z'|&#8217;-'|&#8217;0&#8242;..&#8217;9&#8242;)* ;</p>
<p>An additional Xpand templates generates a nice Xtext grammar. Now we just have to get rid of the left recursion. As there is an algorithm for that too, we are thinking of putting that algorithm in the generator.</p>
<p>Another application could be the generation of a parser for the textual format for message sequence charts, as this definition is also available in BNF.</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2010/03/12/xtext-bnf-marte-and-mscs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another kind of domain specific</title>
		<link>http://5ise.quanxinquanyi.de/2010/03/11/another-kind-of-domain-specific/</link>
		<comments>http://5ise.quanxinquanyi.de/2010/03/11/another-kind-of-domain-specific/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 22:24:47 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[China]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=184</guid>
		<description><![CDATA[On the lighter side of DSLs, Xtext 0.8M5 fixes a bug with unicode characters. It is now possible to use Unicode characters in literals of your grammar. So the example grammar of new Xtext Projects in Chinese could look like this: Of course, content assist and outline are fully supported: All you have to do [...]]]></description>
			<content:encoded><![CDATA[<p>On the lighter side of DSLs, Xtext 0.8M5 fixes a bug with unicode characters. It is now possible to use Unicode characters in literals of your grammar.</p>
<p>So the example grammar of new Xtext Projects in Chinese could look like this:</p>
<p><img class="alignnone size-full wp-image-185" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/03/xtext-zh.png" alt="xtext-zh" /></p>
<p>Of course, content assist and outline are fully supported:</p>
<p><img class="alignnone size-full wp-image-187" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/03/xtext-zh2.png" alt="xtext-zh2" width="539" height="532" /></p>
<p>All you have to do is to set Eclipse to use UTF-8 for the workspace through <em>Window-&gt;Preferences-&gt;General-&gt;Workspace.</em></p>
<p>And, with a little overloading of the ID terminal, like this:</p>
<p>terminal ID :<br />
&#8216;^&#8217;?(&#8216;a&#8217;..&#8217;z'|&#8217;A&#8217;..&#8217;Z'|&#8217;_'|&#8217;ä¸€&#8217;..&#8217;é¾¥&#8217;) (&#8216;a&#8217;..&#8217;z'|&#8217;A&#8217;..&#8217;Z'|&#8217;_'|&#8217;0&#8242;..&#8217;9&#8242;|&#8217;ä¸€&#8217;..&#8217;é¾¥&#8217;)* ;</p>
<p>You can even use chinese characters as IDs:</p>
<p><img class="alignnone size-full wp-image-191" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2010/03/xtext-zh3.png" alt="xtext-zh3" width="780" height="324" /></p>
<p><img src="/DOKUME~1/ANDREA~1/LOKALE~1/Temp/moz-screenshot-3.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2010/03/11/another-kind-of-domain-specific/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UML, good or bad?</title>
		<link>http://5ise.quanxinquanyi.de/2009/09/27/uml-good-or-bad/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/09/27/uml-good-or-bad/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 12:16:50 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=131</guid>
		<description><![CDATA[Via Adriano Comai I stumbled upon Ivar Jacobson&#8217;s articleÂ  &#8220;Taking the temperature of UML&#8221; , an interesting view of one of UML founders on the UML.Â  One of the important quotes is: Still, UML has become complex and clumsy. For 80% of all software only 20% of UML is needed. However, it is not easy [...]]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://acomai.blogspot.com/" onclick="pageTracker._trackPageview('/outgoing/acomai.blogspot.com/?referer=');">Adriano Comai</a> I stumbled upon Ivar Jacobson&#8217;s articleÂ  <a href="http://ivarblog.com/2009/06/30/taking-the-temperature-of-uml/" onclick="pageTracker._trackPageview('/outgoing/ivarblog.com/2009/06/30/taking-the-temperature-of-uml/?referer=');">&#8220;Taking the temperature of UML&#8221; </a>, an interesting view of one of UML founders on the UML.Â  One of the important quotes is:</p>
<p><em>Still, UML has become complex and clumsy. For 80% of all software only 20% of UML is needed. However, it is not easy to find the subset of UML which we would call the â€œEssentialâ€ UML. We must make UML smarter to use.</em></p>
<p>There is a strong point in UML being too big. I have been following UML since its inception, having worked 10 years on one of the first UML tools, Software Through Pictures. Over the time, I have more and more been favouring (textual) DSLs. One of the reasons are the intrinsic problems of graphicalÂ  modelling, so one of the quotes I cannot really agree to:</p>
<p><em>There are a number of good and easy to use tools. </em></p>
<p>The situation has gotten much better, but graphical modeling tools are very complex to get right and I&#8217;d support the statement on one of the speakers on the german<a href="http://www.heise.de/developer/Episode-10-Modellierung-im-Softwarearchitekturumfeld-Teil-1--/blog/artikel/141332" onclick="pageTracker._trackPageview('/outgoing/www.heise.de/developer/Episode-10-Modellierung-im-Softwarearchitekturumfeld-Teil-1--/blog/artikel/141332?referer=');"> Architektour podcast</a> that there are few tools that I really like, only tools that I dislike less. However, in project settings, there might be some influencing factors that makeÂ  UML and UML tooling is the best solution. If you understand german, most of the arguments pro and con UML that I&#8217;d use are mentioned on the Architektour podcast.</p>
<p>I like<span style="text-decoration: underline;"><em><cite></cite></em></span> Pedro J. Molina&#8217;s article in his post <a href="http://pjmolina.com/metalevel/2009/09/using-the-20-percent-of-uml" onclick="pageTracker._trackPageview('/outgoing/pjmolina.com/metalevel/2009/09/using-the-20-percent-of-uml?referer=');">&#8220;Using the 20% of UML&#8221;</a>.</p>
<p>So I don&#8217;t think an &#8220;Essential UML&#8221; would be the right way to go. Time is better invested to find the right DSL for your domain.</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/09/27/uml-good-or-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Conversion of Xtend and UML datatypes in Galileo</title>
		<link>http://5ise.quanxinquanyi.de/2009/08/17/setting-up-conversion-of-xtend-and-uml-datatypes-in-galileo/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/08/17/setting-up-conversion-of-xtend-and-uml-datatypes-in-galileo/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 10:07:34 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=106</guid>
		<description><![CDATA[I was just trying to set up a M2M transformation from a textual DSL to UML2 with the Galileo release. Obviously, a lot of paths have changed from oAW to Galileo, so this needs some work. However, I had an error, that annoyed me. In the editor, everything was fine, no errors, but when running [...]]]></description>
			<content:encoded><![CDATA[<p>I was just trying to set up a M2M transformation from a textual DSL to UML2 with the Galileo release. Obviously, a lot of paths have changed from oAW to Galileo, so this needs some work. However, I had an error, that annoyed me. In the editor, everything was fine, no errors, but when running the workflow, the transformation had errors like:</p>
<pre>EvaluationException : Couldn't find operation 'setName(String)' for uml::Class.
Â Â Â  torcssim::common::m2uml.ext[438,20] on line 23 'this.setName(c.name)'
Â Â Â  torcssim::common::m2uml.ext[315,16] on line 13 'x.components.c()'Â Â Â 
Â Â Â  nofile[0,23] on line 1 'toModel(model,umlmodel)'</pre>
<p>It could not cast from an Xtend String to an UML String. The solution is in adding the meta-model to the component:</p>
<pre>Â &lt;component class="org.eclipse.xtend.XtendComponent"&gt;
Â Â Â  Â &lt;metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/&gt;
Â Â <strong>Â  Â &lt;metaModel class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel"/&gt;</strong>
Â Â Â  Â &lt;invoke value="torcssim::common::m2uml::toModel(model,umlmodel)"/&gt;
Â Â Â  Â &lt;outputSlot value="transformedUMLModel"/&gt;
Â Â Â  &lt;/component&gt;</pre>
<p>Which is quite obvious when you have done it once, but if you try to set it up the first time, it can cost you quite some time. Especially, when everything looks good in the editor.</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/08/17/setting-up-conversion-of-xtend-and-uml-datatypes-in-galileo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>??????????</title>
		<link>http://5ise.quanxinquanyi.de/2009/07/31/%e6%96%87%e6%9c%ac%e7%89%b9%e5%ae%9a%e5%9f%9f%e8%af%ad%e8%a8%80%e7%9a%84%e6%af%94%e8%b5%9b/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/07/31/%e6%96%87%e6%9c%ac%e7%89%b9%e5%ae%9a%e5%9f%9f%e8%af%ad%e8%a8%80%e7%9a%84%e6%af%94%e8%b5%9b/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 09:56:25 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[China]]></category>
		<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>
		<category><![CDATA[privat]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=98</guid>
		<description><![CDATA[itemis ????????????????? . Xtext ? Textual Modeling Framework?TMF???????????? Galileo ??????. ???? Xtext ??? EBNF ???? DSL???????????????? AST ?????? EMF ???????????? Eclipse ??????]]></description>
			<content:encoded><![CDATA[<p>itemis ???????????????<a href="http://xtext.itemis.com/xtext/language=en/25279/model-prize-laureate" onclick="pageTracker._trackPageview('/outgoing/xtext.itemis.com/xtext/language=en/25279/model-prize-laureate?referer=');">??</a> . Xtext ? Textual Modeling Framework?TMF???????????? Galileo ??????. ???? Xtext ??? EBNF ???? DSL???????????????? AST ?????? EMF ???????????? Eclipse ??????</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/07/31/%e6%96%87%e6%9c%ac%e7%89%b9%e5%ae%9a%e5%9f%9f%e8%af%ad%e8%a8%80%e7%9a%84%e6%af%94%e8%b5%9b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vortrag auf der Embedded Software Engineering Kongress 2009 in Sindelfingen</title>
		<link>http://5ise.quanxinquanyi.de/2009/07/31/vortrag-auf-der-embedded-software-engineering-kongress-2009-in-sindelfingen/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/07/31/vortrag-auf-der-embedded-software-engineering-kongress-2009-in-sindelfingen/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 09:44:46 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=94</guid>
		<description><![CDATA[Wir halten am 10.Dezember 2009 um 16:00 Uhr einen Vortrag Ã¼ber die EinfÃ¼hrung von MDSD in einem Projekt auf dem Embedded Software Engineering Kongress 2009 in Sindelfingen: Textuelle domÃ¤nenspezifische Sprachen sind ein starker Trend in der Software-Entwicklung.Â  Welche Lessons-Learned macht ein mittelstÃ¤ndisches Unternehmen bei der EinfÃ¼hrung von modellbasierter Software-Entwicklung fÃ¼rÂ  Embedded Systems? In diesem Talk [...]]]></description>
			<content:encoded><![CDATA[<p>Wir halten am 10.Dezember 2009 um 16:00 Uhr einen Vortrag Ã¼ber die EinfÃ¼hrung von MDSD in einem Projekt auf dem <a href="http://www.ese-kongress.de/programm/" onclick="pageTracker._trackPageview('/outgoing/www.ese-kongress.de/programm/?referer=');">Embedded Software Engineering Kongress 2009 in Sindelfingen</a>:</p>
<p>Textuelle domÃ¤nenspezifische Sprachen sind ein starker Trend in der  Software-Entwicklung.Â  Welche Lessons-Learned macht ein mittelstÃ¤ndisches Unternehmen bei der  EinfÃ¼hrung von modellbasierter Software-Entwicklung fÃ¼rÂ  Embedded Systems? In diesem Talk werden an Hand eines realen Projekts  die Lessons Learned und die Vorteile des Einsatzes von textuellen domÃ¤nenspezifischen Modellen auf Basis von Open Source-Tools erÃ¶rtert.</p>
<p>Gerade im Embedded Bereich wird Modellierung noch mit ineffizienter  Implementierung in Verbindung gebracht.Â  Mit neuen Modellierungstechniken ist dies jedoch nicht der Fall.</p>
<p>Die Referenten werden darÃ¼ber sprechen, wie sich die EinfÃ¼hrung auf  Anforderungsmanagement,Â  Projektplanung, Design und Implementierung auswirken. Somit wird  modellgetriebene Software-Entwicklung nicht nur vom technischen Standpunkt<br />
der Werkzeuge betrachtet, sondern aus einer gesamthaften Projektsicht.</p>
<p>Die Teilnehmer erhalten Informationen Ã¼ber den praktischen Einsatz von  textuellen DSLs, die sie in die Bewertung ihres eigenen Entwicklungsprozesses einbringen kÃ¶nnen. Da es sich um ein  typisches Embedded-System handelt, zeigen wir, dass sich der Einsatz auch in kleineren Projekten und Systemen mit  beschrÃ¤nkten Ressourcen lohnt.</p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/07/31/vortrag-auf-der-embedded-software-engineering-kongress-2009-in-sindelfingen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scoping with Xtext / TMF</title>
		<link>http://5ise.quanxinquanyi.de/2009/07/27/scoping-with-xtext-tmf/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/07/27/scoping-with-xtext-tmf/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 16:53:29 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=88</guid>
		<description><![CDATA[The new Xtext version in Galileo changed a few things. To do scoping, a little bit of Java development is necessary. Documentation is very brief, but with a little research it is quite easy. Consider the following grammar, that allows us to define components, instances of those components and &#8211; the interesting part here &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>The new Xtext version in Galileo changed a few things. To do scoping, a little bit of Java development is necessary. Documentation is very brief, but with a little research it is quite easy. Consider the following grammar, that allows us to define components, instances of those components and &#8211; the interesting part here &#8211; connect ports of instances:</p>
<pre>Component :
Â Â Â  "component" name = ID "{"
Â Â Â  (ports+=Port)*
Â Â Â  "}";

Port :
Â Â Â  "port" dir=Direction name=ID ":"Â  ref=[Interface|ID] ";"
Â Â Â  ;

enum Direction :
Â Â Â  IN="in" | OUT="out";

Instance:
Â Â Â  "instance" name=ID ":" type=[Component|ID] ";"
Â Â Â  ;

Connection:
Â Â Â  "connect" in=[Instance|ID]"."p=[Port|ID] "-&gt;" in2=[Instance|ID]"."p2=[Port|ID] ";"
Â Â Â  ;</pre>
<p>The default code completion will traverse all defined Ports for the references p and p2 in the Connection rule. A better behaviour would be:</p>
<ul>
<li>Show only the ports in the instances (in, in2)</li>
<li>For p, show only &#8220;OUT&#8221;-Ports, for p2, show only &#8220;IN&#8221;-ports.</li>
</ul>
<p>To do this, we need to define methods in a class derived from AbstractDeclarativeScopeProvider. The method names follow the signature scope_&lt;rule&gt;_&lt;element&gt;, so the code fragment for p2 is:</p>
<pre>IScope scope_Connection_p2(Connection ctx, EReference ref)
Â Â Â  {
Â Â Â  Â Â Â  if(ctx.getIn2() == null )
Â Â Â  Â Â Â  Â Â Â  return IScope.NULLSCOPE;
Â Â Â  Â Â Â  else
Â Â Â  Â Â Â  Â Â Â  return new SimpleScope(IScope.NULLSCOPE, getRPorts(ctx.getIn2().getType()));

Â Â Â  }</pre>
<p>With some additional code the full Provider for p and p2 looks like this:</p>
<pre>public class AutomotiveDSLScopeProvider extends AbstractDeclarativeScopeProvider {</pre>
<pre>Â Â Â  IScope scope_Connection_p2(Connection ctx, EReference ref)</pre>
<pre>Â Â Â  {</pre>
<pre>Â Â Â  Â Â Â  if(ctx.getIn2() == null )</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  return IScope.NULLSCOPE;</pre>
<pre>Â Â Â  Â Â Â  else</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  return new SimpleScope(IScope.NULLSCOPE, getRPorts(ctx.getIn2().getType()));</pre>
<pre>
Â Â Â  }</pre>
<pre></pre>
<pre>Â Â Â  IScope scope_Connection_p(Connection ctx, EReference ref)</pre>
<pre>Â Â Â  {</pre>
<pre>Â Â Â  Â Â Â  if(ctx.getIn() == null )</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  return IScope.NULLSCOPE;</pre>
<pre>Â Â Â  Â Â Â  else</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  return new SimpleScope(IScope.NULLSCOPE, getPPorts(ctx.getIn().getType()));</pre>
<pre>
Â Â Â  }</pre>
<pre>Â Â Â  private Iterable&lt;IScopedElement&gt; getPPorts(Component clazz) {</pre>
<pre>Â Â Â  Â Â Â  List&lt;IScopedElement&gt; result = new ArrayList&lt;IScopedElement&gt;();</pre>
<pre></pre>
<pre>Â Â Â  Â Â Â  for (Port f : clazz.getPorts())</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  if (f instanceof Port &amp;&amp; f.getDir() == Direction.OUT)</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  Â Â Â  result.add(ScopedElement.create(f.getName(), f,"("));</pre>
<pre></pre>
<pre>Â Â Â  Â Â Â  return result;</pre>
<pre>Â Â Â  }</pre>
<pre></pre>
<pre>Â Â Â  private Iterable&lt;IScopedElement&gt; getRPorts(Component clazz) {</pre>
<pre>Â Â Â  Â Â Â  List&lt;IScopedElement&gt; result = new ArrayList&lt;IScopedElement&gt;();</pre>
<pre></pre>
<pre>Â Â Â  Â Â Â  for (Port f : clazz.getPorts())</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  if (f instanceof Port &amp;&amp; f.getDir() == Direction.IN)</pre>
<pre>Â Â Â  Â Â Â  Â Â Â  Â Â Â  result.add(ScopedElement.create(f.getName(), f));</pre>
<pre></pre>
<pre>Â Â Â  Â Â Â  return result;</pre>
<pre>Â Â Â  }</pre>
<pre></pre>
<pre>}</pre>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/07/27/scoping-with-xtext-tmf/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Screencast Transcript: MDSD for on- and off-board software</title>
		<link>http://5ise.quanxinquanyi.de/2009/07/22/screencast-transcript-mdsd-for-on-and-off-board-software/</link>
		<comments>http://5ise.quanxinquanyi.de/2009/07/22/screencast-transcript-mdsd-for-on-and-off-board-software/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 12:33:11 +0000</pubDate>
		<dc:creator>Andreas Graf</dc:creator>
				<category><![CDATA[DSL]]></category>
		<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://5ise.quanxinquanyi.de/?p=80</guid>
		<description><![CDATA[This is a transcript of the first itemis screencast introducing model based design and implementation for embedded systems. It is intended for those readers that cannot access the screencast. The screencast is on Youtube. Introduction Welcome to the itemis introduction screencast for Model Driven Software-Design for On- and Off-board software. This is the first in [...]]]></description>
			<content:encoded><![CDATA[<p><!--[if !mso]&gt;--></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">This is a transcript of the first itemis screencast introducing model based design and implementation for embedded systems. It is intended for those readers that cannot access the screencast. The <a href="http://www.youtube.com/watch?v=api95jRYxzc" onclick="pageTracker._trackPageview('/outgoing/www.youtube.com/watch?v=api95jRYxzc&amp;referer=');">screencast is on Youtube</a>.<br />
</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><strong><span style="font-size: 18pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Introduction</span></strong></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Welcome to the itemis introduction screencast for Model Driven Software-Design for On- and Off-board software.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">This is the first in a series of screencasts where we explain various aspects of Model Driven Software Design for complex systems comprised of embedded processors, mobile applications and enterprise infrastructure. We will show how to use open source tools for the engineering process. This screencast will explain the motivation and methodology for model driven software design and introduce the showcase that is used to explain various aspects in the following screencasts.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Software in embedded systems is getting increasingly complex. It is now a major part of electronics development. In addition, embedded systems are more and more connected. Modern cars consist of nearly 100 embedded control units and a complex network. And those systems are connected to off-board systems, as for example in remote diagnosis systems. This is an engineering challenge. We need flexible, reliable systems that comply with various safety standards. Those standards define process and methodologies for safety-critical systems. Manual engineering of software often leads to errors and increased cost in complex systems. We need a methodology and tools that can handle those systems.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">We at itemis meet those challenges with model based design. Models help to manage complexity by increasing the level of abstraction. That allows us to discuss the relevant aspects for a problem and not getting confused by all the other aspects. A good model will separate the domain knowledge from the underlying infrastructure. It will also have different views for dynamic and static aspects of the system. </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">By raising the level of abstraction, a good model will provide a better understanding of the problem at hand. It will improve communication in the project team. And a good model will always be up to date and represent the actual system. </span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">However, that is not enough.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">To reduce the error-prone manual coding, a good model has to support code generation. It will also support generation of a test framework and generation of the documentation. So, the model has to be at the core of the development process.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">So does it this approach really work? Yes it does. We have set up a showcase to show how model driven software design works in embedded and enterprise systems.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><strong><span style="font-size: 18pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Showcase</span></strong></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">The showcase system that we built is an example from the automotive domain.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">It consists of three major parts. The sensor, the embedded devices and the enterprise applications.</span></p>
<p class="MsoNormal"><img src="/DOKUME~1/ANDREA~1/LOKALE~1/Temp/moz-screenshot.jpg" alt="" /><img src="/DOKUME~1/ANDREA~1/LOKALE~1/Temp/moz-screenshot-1.jpg" alt="" /></p>
<p class="MsoNormal" style="page-break-after: avoid;"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"><!--[if gte vml 1]&gt;                    &lt;![endif]--><!--[if !vml]--><!--[endif]--></span></p>
<p class="MsoCaption" style="text-align: center;" align="center"><img src="/DOKUME~1/ANDREA~1/LOKALE~1/Temp/moz-screenshot-2.jpg" alt="" /><span lang="EN-US"><img class="alignnone size-full wp-image-82" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2009/07/showcase1.png" alt="Pic 1" width="633" height="375" /></span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"><span> </span>To simulate a real sensor, we patched the open source racing simulation &#8220;Torcs&#8221; to send out information about the car state. Telemetric data from the sensor is sent throughout the system. It is generated by a virtual sensor on a PC and sent through an UDP link to a Gateway. This gateway is a blackfin board running Embedded Linux. The telemetric data is then sent over two channels. On the embedded side, it is broadcast on a CAN bus, where it is received by a display 3000 board. This is an atmel processor without operating system, but with a small display.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">On the enterprise side, the data is sent over a serial link to a PC running a JBOSS application server. It can then remotely be accessed from iphones and android phones by means of standard web services.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">With a manual approach, code for all these plattforms would have to be manually written. </span><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">This is a source for errors and problems.</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">With model driven software design, we use an abstract unified model to represent the system. We generate code for all those platforms automatically and increasing the speed of the engineering process. </span></p>
<p class="MsoNormal" style="page-break-after: avoid;"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"><!--[if gte vml 1]&gt;   &lt;![endif]--><!--[if !vml]--><!--[endif]--></span></p>
<p class="MsoCaption" style="text-align: left;"><img class="alignnone size-full wp-image-83" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2009/07/showcase2.png" alt="showcase2" width="631" height="463" /></p>
<p class="MsoCaption" style="text-align: center;" align="center"><span lang="EN-US"><br />
</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">The power of model-based engineering is easily visible if we introduce a second item of sensor data, for example the rotations per minutes of the motor. All the software in the system would have to be changed manually, to handle the additional information.</span></p>
<p class="MsoNormal" style="page-break-after: avoid;"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"><!--[if gte vml 1]&gt;   &lt;![endif]--><!--[if !vml]--><!--[endif]--></span></p>
<p class="MsoCaption" style="text-align: left;"><span lang="EN-US"><img class="alignnone size-full wp-image-84" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2009/07/showcase3.png" alt="showcase3" width="636" height="378" /><br />
</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"><span> </span>However, with model based design, we just add the new piece of information to the model and then regenerate the code for the entire system.</span></p>
<p class="MsoNormal" style="page-break-after: avoid;"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"><!--[if gte vml 1]&gt;   &lt;![endif]--><!--[if !vml]--><!--[endif]--></span></p>
<p class="MsoCaption" style="text-align: left;"><span lang="EN-US"><img class="alignnone size-full wp-image-85" src="http://5ise.quanxinquanyi.de/wp-content/uploads/2009/07/showcase4.png" alt="showcase4" width="626" height="468" /><br />
</span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><strong><span style="font-size: 18pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">More Information</span></strong></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">We will explain methods and tools in several screencasts. You have just seen a summary of the introduction screencast. </span></p>
<ul>
<li><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Screencast 2 will explain the use of domain specific languages for architecture modeling and code generation.<br />
</span></li>
<li><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Screencast 3 will show how to use an eclipse-based open source toolchain for developing software for embedded systems.</span></li>
<li><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">In Screencast 4 we will bridge the gap from embedded systems to enterprise application and generate the infrastructure and mobile applications.<br />
</span></li>
<li><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;" lang="EN-US">Screencast 5 explains the handling of variants and product lines. Screencast 6 will deal with model based diagnosis of embedded systems.<br />
</span></li>
</ul>
<p><span style="font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;">All screencasts use the same showcase system. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://5ise.quanxinquanyi.de/2009/07/22/screencast-transcript-mdsd-for-on-and-off-board-software/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
