<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nirmal&#039;s Blog</title>
	<atom:link href="http://nirmalsasidharan.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nirmalsasidharan.wordpress.com</link>
	<description>Burn your eyes</description>
	<lastBuildDate>Thu, 25 Apr 2013 00:03:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nirmalsasidharan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nirmal&#039;s Blog</title>
		<link>http://nirmalsasidharan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nirmalsasidharan.wordpress.com/osd.xml" title="Nirmal&#039;s Blog" />
	<atom:link rel='hub' href='http://nirmalsasidharan.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Eclipse Project Set Editor</title>
		<link>http://nirmalsasidharan.wordpress.com/2013/01/15/eclipse-project-set-editor/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2013/01/15/eclipse-project-set-editor/#comments</comments>
		<pubDate>Tue, 15 Jan 2013 20:30:19 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=958</guid>
		<description><![CDATA[An Eclipse Project Set file (.psf) enables quick export and import of files from a repository like Git, SVN etc. Eclipse currently supports exporting files in a repository as a Project Set file. An editor for an existing PSF file is currently missing. The means updating an existing PSF file (for example, adding a new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=958&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nirmalsasidharan.files.wordpress.com/2013/01/psfeditor.png"><img class="size-full wp-image-959 alignleft" alt="psfeditor" src="http://nirmalsasidharan.files.wordpress.com/2013/01/psfeditor.png?w=595"   /></a>An Eclipse <a href="http://wiki.eclipse.org/PSF" rel="nofollow">Project Set</a> file (.psf) enables quick export and import of files from a repository like Git, SVN etc. Eclipse currently <a href="http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-cvs-project-set.htm" rel="nofollow">supports</a> exporting files in a repository as a Project Set file. An editor for an existing PSF file is currently missing. The means updating an existing PSF file (for example, adding a new project, removing an existing project etc.) means editing PSF XML by hand!</p>
<p>The Project Set Editor provides a simple user interface to view and edit PSF files (similar to Manifest Editor or Target Definition Editor). The editor also allows directly importing the artifacts in a PSF file.</p>
<p>You can find the project at Eclipse Labs: <a href="http://code.google.com/a/eclipselabs.org/p/psfeditor/" rel="nofollow">http://code.google.com/a/eclipselabs.org/p/psfeditor/</a></p>
<p>Doors are open for testers and committers.</p>
<p>&nbsp;</p>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/git/'>Git</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/svn/'>SVN</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/958/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/958/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=958&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2013/01/15/eclipse-project-set-editor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2013/01/psfeditor.png" medium="image">
			<media:title type="html">psfeditor</media:title>
		</media:content>
	</item>
		<item>
		<title>RIF meets ReqIF</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/08/09/rif-meets-reqif/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/08/09/rif-meets-reqif/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 10:05:07 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[EMF]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[RMF]]></category>
		<category><![CDATA[ReqIF]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[RIF]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=928</guid>
		<description><![CDATA[ReqIF is the new OMG standard for requirements interchange. RIF is the predecessor to it and already supported by many tools like DOORS. RMF delivers both the standards as Ecore models. However, there are quite a few differences between the two standards making them type incompatible. The main differences lies in, 1. Element naming. For [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=928&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>ReqIF is the new <a href="http://www.omg.org/spec/ReqIF/">OMG standard </a>for requirements interchange. RIF is the predecessor to it and already supported by many tools like DOORS. <a href="http://www.eclipse.org/proposals/modeling.mdt.rmf/">RMF</a> delivers both the standards as Ecore models. However, there are quite a few differences between the two standards making them type incompatible.</p>
<p>The main differences lies in,</p>
<p>1. Element naming.<br />
For example, the element <em>RIF</em> is now called <em>REQIF, SpecHierarchyRoot</em> is now <em>Specification</em> and so on.</p>
<p>2. More specification types.<br />
If you know the RIF model already, you would know the concept of <em>SpecType</em>s. This element allows creation of new types. In RIF and ReqIF, <em>SpecObject</em>s (the instance values)  and <em>SpecRelation</em>s (relations between instances) are typed. However, in RIF, both refer to the same <em>SpecType</em> element, where as ReqIF has different types called <em>SpecObjectType</em> for <em>SpecObject</em>, <em>SpecRelationType</em> for <em>SpecRelation</em> and some more new types.</p>
<p>3. More attribute definition and value types.<br />
RIF had only a single attribute definition type called  <em>AttributeDefinitionSimple</em>. ReqIF extends this for different the different data types as <em>AttributeDefinitionInteger</em>, <em>AttributeDefinitionReal</em>, <em>AttributeDefinitionString</em> etc. Same for values as <em>AttributeValueInteger</em>, <em>AttributeValueReal</em>, <em>AttributeValueString</em> etc.</p>
<p>4. RIF XML uses no XML attributes where as ReqIF uses a lot of them.<br />
For example, <em>IDENTIFIER</em> is an XML element in RIF whereas it is a XML attribute in ReqIF.</p>
<p>This brings us to the question &#8211; how do I convert my existing RIF files to the new ReqIF format? Considering the fact that there are a lot of industry samples in RIF format, we thought of writing a RIF to ReqIF converter. The transformer takes in a RIF file and transforms it into a ReqIF, retaining all its contents. You could also do an in-memory transformation between the two models.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rif2reqif_w_bg1.png"><img class="aligncenter size-full wp-image-942" title="RIF2ReqIF_w_bg" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rif2reqif_w_bg1.png?w=595" alt=""   /></a></p>
<p>This is how a RIF source than we passed to our converter looks like after transformation.</p>
<div class="wp-caption aligncenter" style="width: 610px"><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rif_source.png"><img class=" " title="Source" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rif_source.png?w=600&#038;h=429" alt="" width="600" height="429" /></a><p class="wp-caption-text">RIF Source</p></div>
<div id="attachment_937" class="wp-caption aligncenter" style="width: 610px"><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/reqif_target.png"><img class="size-full wp-image-937" title="Target" src="http://nirmalsasidharan.files.wordpress.com/2011/08/reqif_target.png?w=595" alt=""   /></a><p class="wp-caption-text">ReqIF Target</p></div>
<p style="text-align:center;">
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/reqif/'>ReqIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/requirements/'>requirements</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rif/'>RIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rmf-2/'>RMF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/928/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/928/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=928&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/08/09/rif-meets-reqif/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rif2reqif_w_bg1.png" medium="image">
			<media:title type="html">RIF2ReqIF_w_bg</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rif_source.png" medium="image">
			<media:title type="html">Source</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/reqif_target.png" medium="image">
			<media:title type="html">Target</media:title>
		</media:content>
	</item>
		<item>
		<title>2 Fast thrice Furious</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/08/03/2-fast-thrice-furious/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/08/03/2-fast-thrice-furious/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 13:24:24 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[RMF]]></category>
		<category><![CDATA[ReqIF]]></category>
		<category><![CDATA[RIF]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=908</guid>
		<description><![CDATA[Preparing to make the initial code contribution for RMF, we ran our RIF/ReqIF metamodels through several performance tests. To start with, we tested the load and save times of RIF files based on some industry samples. To get some comparison data, we generated XMI files using the same data held in RIF XML files and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=908&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/2f3f.png"><img class="alignright" title="2f3f" src="http://nirmalsasidharan.files.wordpress.com/2011/07/2f3f.png?w=218&#038;h=413" alt="" width="218" height="413" /></a>Preparing to make the initial code contribution for <a href="http://www.eclipse.org/proposals/modeling.mdt.rmf/">RMF</a>, we ran our RIF/ReqIF metamodels through several performance tests. To start with, we tested the load and save times of RIF files based on some industry samples. To get some comparison data, we generated XMI files using the same data held in RIF XML files and tested the load/save time against it. The results are quite promising.</p>
<p>Before we go into the details of the tests, its better to define two components involved in our test comparisons.</p>
<ul>
<li>The customized RIF XML loader (a.k.a RMF Loader) and serializer (a.k.a RMF Serializer) for loading/saving OMG RIF XML files into RIF Ecore metamodel (read more on the metamodel implementation <a href="http://nirmalsasidharan.wordpress.com/2011/07/29/dissecting-rifreqif-metamodel/">here</a>).</li>
<li>The default RIF XMI loader and serializer for  loading/saving RIF XMI files into RIF Ecore model (this is not in the scope of RMF. We use this only to get some comparison).</li>
</ul>
<p>Here are some highlights from our tests.</p>
<ul>
<li>A 32MB RIF XML file is loaded in 14.4 seconds by RMF loader where as the same data in XMI format is loaded by the default EMF XMI loader in 22.2 seconds (and 70 mins(!!) without any optimizations to the XMI loader)</li>
<li>The average time taken to load per MB of data from RIF XML is 0.5 seconds, whereas RIF XMI takes 1.63 seconds per MB. For save, average time taken per MB of data to RIF XML is 0.09 seconds, whereas RIF XMI takes 1.22 seconds per MB</li>
<li>The load and save time for RIF XML files by RMF loader/serializer increases linearly with size</li>
</ul>
<div><span style="color:#0000ee;"><span style="text-decoration:underline;"><span style="color:#000000;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test1.png"><img class="aligncenter size-full wp-image-917" title="rmf_load_test1" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test1.png?w=595" alt=""   /></a></span></span></span></div>
<div><span style="color:#0000ee;"><span style="text-decoration:underline;"><span style="color:#000000;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test2.png"><img class="aligncenter size-full wp-image-918" title="rmf_load_test2" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test2.png?w=595" alt=""   /></a></span></span></span></div>
<div></div>
<div></div>
<div></div>
<div><span style="color:#0000ee;"><span style="text-decoration:underline;"><span style="color:#000000;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test1.png"><img class="aligncenter size-full wp-image-919" title="rmf_save_test1" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test1.png?w=595" alt=""   /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test2.png"><img class="aligncenter size-full wp-image-920" title="rmf_save_test2" src="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test2.png?w=595" alt=""   /></a><br />
</span></span></span></div>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/reqif/'>ReqIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rif/'>RIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rmf-2/'>RMF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/908/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/908/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=908&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/08/03/2-fast-thrice-furious/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/2f3f.png" medium="image">
			<media:title type="html">2f3f</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test1.png" medium="image">
			<media:title type="html">rmf_load_test1</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_load_test2.png" medium="image">
			<media:title type="html">rmf_load_test2</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test1.png" medium="image">
			<media:title type="html">rmf_save_test1</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/08/rmf_save_test2.png" medium="image">
			<media:title type="html">rmf_save_test2</media:title>
		</media:content>
	</item>
		<item>
		<title>Dissecting RIF/ReqIF metamodel</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/07/29/dissecting-rifreqif-metamodel/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/07/29/dissecting-rifreqif-metamodel/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 11:52:06 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[EMF]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[RMF]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[OMG]]></category>
		<category><![CDATA[ReqIF]]></category>
		<category><![CDATA[RIF]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=888</guid>
		<description><![CDATA[RIF/ReqIF is the new OMG standard for requirements interchange. RMF (currently in proposal phase) provides an EMF Ecore based metamodel implementation for the RIF/ReqIF XML format. The metamodel is a clean implementation of the format without any &#8220;XML noise&#8221;. The Ecore metamodel also conforms to the CMOF metamodel delivered by OMG (as it has been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=888&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.omg.org/spec/ReqIF/"><br />
</a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/diss_rif.png"><img class="alignright" title="diss_rif" src="http://nirmalsasidharan.files.wordpress.com/2011/07/diss_rif.png?w=216&#038;h=216" alt="" width="216" height="216" /></a><a href="http://www.omg.org/spec/ReqIF/">RIF/ReqIF</a> is the new OMG standard for requirements interchange. <a href="http://www.eclipse.org/proposals/modeling.mdt.rmf/">RMF</a> (currently in proposal phase) provides an EMF Ecore based metamodel implementation for the RIF/ReqIF XML format. The metamodel is a clean implementation of the format without any &#8220;XML noise&#8221;. The Ecore metamodel also conforms to the CMOF metamodel delivered by OMG (as it has been derived from it). The metamodel reads/writes RIF/ReqIF data in conformance with the RIF/ReqIF XML Schema.<a href="http://nirmalsasidharan.files.wordpress.com/2011/07/diss_rif.png"><br />
</a></p>
<p>The challenge in the Ecore based RIF/ReqIF implementation was the customization of loaders and serializers to make them RIF/ReqIF XML Schema conformant. EMF provides different ways of customizing the XML output.</p>
<p>1. Using <a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/util/class-use/ExtendedMetaData.html">ExtendedMetadata</a> annotations.</p>
<p>2. Implementing new <a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xmi/class-use/XMLLoad.html">XMLLoad</a>, <a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xmi/XMLSave.html">XMLSave</a> and <a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xmi/XMLHelper.html">XMLHelper</a>.</p>
<p>Both approaches are quite tricky to implement when the expected XML output has structural differences compared to the Ecore metamodel. For example, the XML output has wrapper elements for lists (<a href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.5.0/org/eclipse/emf/common/util/EList.html">EList</a>s) in the Ecore metamodel.</p>
<p>We went in for a third approach.</p>
<p>We imported RIF/ReqIF XML schema using EMF importer to create a RIF/ReqIF XML Ecore model (Anyone who has done this, knows it&#8217;s an &#8220;ugly&#8221; metamodel that EMF generates here). The next step was to create the real RIF/ReqIF metamodel, by importing RIF/ReqIF CMOF file. We then wrote a generic (of course reusable) Ecore XML to Ecore converter to do a model to model transformation in both directions. The whole processing is cleanly hidden in a new EMF Resource implementation such that the user hardly knows anything about these.</p>
<p style="text-align:center;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_load2.png"><img class="aligncenter size-full wp-image-902" title="rmf_load" src="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_load2.png?w=595" alt=""   /></a></p>
<p>The following are the advantages we saw in the approach.</p>
<p>1. You don&#8217;t do customizations at a XML level, but at a higher EMF model API level. That is, you don&#8217;t hack some XML SAX events, but work with familiar EMF APIs.</p>
<p>2. The generic Ecore converter has enough hooks to plugin in the transformations.</p>
<p>3. Easy maintenance as the customizations are available in one place.</p>
<p>The drawback of this approach could be the processing involved in the model to model transformation. However, the highly optimized model to model transformation we implemented doesn&#8217;t make it all that slow. Our performance tests proves this (which would be the topic of my next blog post). It is infact upto 300 times faster than having the same data in the default XMI format (Yes I meant 300! Ed Merks is going to get back to me on this I hope ;) )<a href="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance.png"><img class="aligncenter size-full wp-image-905" title="rmf_performance" src="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance.png?w=595" alt=""   /></a></p>
<p><em>Edit</em>:</p>
<p>Ed did get back to me. With the performance optimizations applied to XMIResource loader to use cache for Intrinsic Ids and URIs, the performance improved dramatically. The XMI resource loader now takes only 22,2s to load a 32MB sample, compared to the earlier 70mins. I am glad that our RIF XMLResource however takes only 14,4s for the same contents.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance_optimized.png"><img class="aligncenter size-full wp-image-915" title="rmf_performance_optimized" src="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance_optimized.png?w=595" alt=""   /></a></p>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/omg/'>OMG</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/reqif/'>ReqIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rif/'>RIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rmf-2/'>RMF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/888/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/888/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=888&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/07/29/dissecting-rifreqif-metamodel/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/diss_rif.png" medium="image">
			<media:title type="html">diss_rif</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_load2.png" medium="image">
			<media:title type="html">rmf_load</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance.png" medium="image">
			<media:title type="html">rmf_performance</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_performance_optimized.png" medium="image">
			<media:title type="html">rmf_performance_optimized</media:title>
		</media:content>
	</item>
		<item>
		<title>Now Launched &#8211; &#8220;itemis Stuttgart&#8221;</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/07/22/now-launched-itemis-stuttgart/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/07/22/now-launched-itemis-stuttgart/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 08:24:58 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Itemis]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=861</guid>
		<description><![CDATA[Beginning of the year itemis opened its new location in Stuttgart. Now that we have settled down here, we made an official launch party. It was a nice little event attended by some of our customers and of course the itemikers. The event took place at &#8220;Stuttgarter Engineering Park (STEP)&#8221; where itemis has its new home. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=861&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/open.jpg"><img class="alignright size-medium wp-image-883" title="Open" src="http://nirmalsasidharan.files.wordpress.com/2011/07/open.jpg?w=240&#038;h=133" alt="" width="240" height="133" /></a>Beginning of the year itemis opened its new location in Stuttgart. Now that we have settled down here, we made an official launch party. It was a nice little event attended by some of our customers and of course the itemikers. The event took place at &#8220;Stuttgarter Engineering Park (<a href="http://www.step-gmbh.com/step/inhalt/nav/parkkonzept/allesauseinerhand.xml?ceid=109168">STEP</a>)&#8221; where itemis has its new home.</p>
<p><a href="https://www.xing.com/profile/Kurt_Ebert2">Kurt Ebert</a>, who manages the new location, welcomed everyone. Here are some keywords from his <a href="http://dl.dropbox.com/u/1503450/ItemisLaunch_20072011/20-07-PPT-kurt.pdf">speech</a>.</p>
<ul>
<li>itemis was founded in 2003; 2006 in South Germany</li>
<li>10 locations in Europe now</li>
<li>150 employees in total, 18 at itemis Stuttgart</li>
</ul>
<p>Markus Völter, then gave an excellent talk on &#8220;<a href="http://dl.dropbox.com/u/1503450/ItemisLaunch_20072011/IntroductionToMDD-neuMitTheorie-itemis-PRINT.pdf">Model-Driven Development and DSLs</a>&#8220;.During the one hour lively talk, he went on talking about the history of MDD and DSLs. What was even more interesting was when he displayed some DSLs he implemented for some real world applications like a &#8220;Pension Fund Specification&#8221; and &#8220;Fountains&#8221; (Fountain is no new buzzword, its the fountain you see at parks :) ).</p>
<p style="text-align:center;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3757.jpg"><img class="size-medium wp-image-869 aligncenter" title="IMG_3757" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3757.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3765.jpg"><img class="size-medium wp-image-871 aligncenter" title="IMG_3765" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3765.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3763.jpg"><img class="size-medium wp-image-870 aligncenter" title="IMG_3763" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3763.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a></p>
<p>The coffee break was a chance to get to know some new faces and welcome some familiar faces to our new location.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3772.jpg"><img class="aligncenter size-medium wp-image-876" title="IMG_3772" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3772.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_37681.jpg"><img class="aligncenter size-medium wp-image-875" title="IMG_3768" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_37681.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a></p>
<p>The second presentation of the day was from <a href="http://www.xing.com/profile/Andreas_Graf">Andreas Graf</a> and myself on &#8220;<a href="http://dl.dropbox.com/u/1503450/ItemisLaunch_20072011/Requirements-DSLs-2.pdf">Requirements, Traceability &amp; DSLs</a>&#8220;. Andreas Graf&#8217;s &#8220;Presentation Zen style&#8221; slides appeared to catch everyone&#8217;s attention. He talked about the new activities at itemis on Requirements Engineering solutions. In between the talks, I managed to give a glimpse of the new tools with 3 demos.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3777.jpg"><img class="aligncenter size-medium wp-image-878" title="IMG_3777" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3777.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a></p>
<p>The light dinner was again a chance to meet more people.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3780.jpg"><img class="aligncenter size-medium wp-image-879" title="IMG_3780" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3780.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3784.jpg"><img class="aligncenter size-medium wp-image-880" title="IMG_3784" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3784.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3794.jpg"><img class="aligncenter size-medium wp-image-881" title="IMG_3794" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3794.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3716.jpg"><img class="aligncenter size-medium wp-image-877" title="IMG_3716" src="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3716.jpg?w=300&#038;h=199" alt="" width="300" height="199" /></a></p>
<p>Thanks to all for attending. More images from the day can be found <a href="https://www.dropbox.com/gallery/1503450/1/ItemisLaunch_20072011?h=310379">here</a>.</p>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/itemis/'>Itemis</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/861/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/861/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=861&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/07/22/now-launched-itemis-stuttgart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/open.jpg?w=300" medium="image">
			<media:title type="html">Open</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3757.jpg?w=300" medium="image">
			<media:title type="html">IMG_3757</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3765.jpg?w=300" medium="image">
			<media:title type="html">IMG_3765</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3763.jpg?w=300" medium="image">
			<media:title type="html">IMG_3763</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3772.jpg?w=300" medium="image">
			<media:title type="html">IMG_3772</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_37681.jpg?w=300" medium="image">
			<media:title type="html">IMG_3768</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3777.jpg?w=300" medium="image">
			<media:title type="html">IMG_3777</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3780.jpg?w=300" medium="image">
			<media:title type="html">IMG_3780</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3784.jpg?w=300" medium="image">
			<media:title type="html">IMG_3784</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3794.jpg?w=300" medium="image">
			<media:title type="html">IMG_3794</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/img_3716.jpg?w=300" medium="image">
			<media:title type="html">IMG_3716</media:title>
		</media:content>
	</item>
		<item>
		<title>Requirements Modeling Framework (RMF)</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/07/18/requirements-modeling-framework-rmf/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/07/18/requirements-modeling-framework-rmf/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 07:46:10 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[RMF]]></category>
		<category><![CDATA[ReqIF]]></category>
		<category><![CDATA[RIF]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=797</guid>
		<description><![CDATA[Over the last few months some guys at itemis and Düsseldorf University have been working closely to bring out a solution to the open in an effort to lessen the big gap we have currently in Eclipse Ecosystem in the area of Requirements Management (RM). Requirements Modeling Framework (RMF) has been proposed to Eclipse Foundation as an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=797&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_at_work.png"><img class="alignright size-full wp-image-845" title="rmf_at_work" src="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_at_work.png?w=595" alt="" /></a>Over the last few months some guys at itemis and Düsseldorf University have been working closely to bring out a solution to the open in an effort to lessen the big gap we have currently in Eclipse Ecosystem in the area of Requirements Management (RM). Requirements Modeling Framework (RMF) has been <a href="http://www.eclipse.org/proposals/modeling.mdt.rmf/">proposed</a> to Eclipse Foundation as an open source project under <a href="http://www.eclipse.org/modeling/mdt/">Model Development Tools Project</a>.</p>
<h2>Scope of RMF</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_architecture1.png"><img class="alignleft size-full wp-image-816" title="reqif_architecture" src="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_architecture1.png?w=595" alt=""   /></a>The scope of the project, as described in the <a href="http://www.eclipse.org/proposals/modeling.mdt.rmf/">proposal</a>, is to provide an implementation for the OMG <a href="http://www.omg.org/spec/ReqIF/" target="_blank">ReqIF</a> standard (just as the Eclipse <a href="http://www.eclipse.org/modeling/mdt/?project=uml2" target="_blank">UML2</a> project provides an EMF based metamodel for OMG <a href="http://www.omg.org/spec/UML/" target="_blank">UML</a>). Requirements management tools could then base their implementation on the provided ReqIF metamodel. It is also in the scope of the project to deliver a requirements authoring tool, again based on the ReqIF metamodel and optionally a generic traceability solution.</p>
<h2>Significance of ReqIF</h2>
<p>ReqIF (Requirements Interchange Format) is an open standard from OMG for requirements exchange (I had <a href="http://nirmalsasidharan.wordpress.com/2010/09/06/filling-the-void/" target="_blank">blogged</a> a while ago on how we arrived at ReqIF (earlier called RIF)). Many tools like DOORS already support a snapshot export to this format. Having an EMF based metamodel for ReqIF, opens up the Eclipse framework for integration and new tool development in the area of Requirements Engineering.</p>
<h2>ReqIF in a nutshell</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_mm3.png"><img class="aligncenter size-full wp-image-834" title="reqif_mm" src="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_mm3.png?w=595" alt=""   /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_mm2.png"><br />
</a>ReqIF offers a generic metamodel to capture requirements (The generic nature is at times highly criticized. More on that later). The figure above shows a bird&#8217;s-eye view of the metamodel. The metamodel allows creation of requirement types (SpecType) with different attributes types and also instances for it (SpecObject). Since ReqIF also carries the metadata (in the form of SpecTypes), it makes it possible for any tool that understands ReqIF to process the data.</p>
<p>ReqIF also allows creating hierarchy for requirements, grouping them and controlling user access. To support rich text, the metamodel reuses XHTML.</p>
<h2>Generic nature and &#8220;meta&#8221;ness of ReqIF</h2>
<p>Anyone expecting a requirements metamodel might be surprised at first when they have a look at ReqIF. You hardly find a term called &#8220;requirement&#8221; in there. ReqIF is more at a higher meta-level, that is M1. It has been designed this way for a reason.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/requirement_cartoon.png"><img class="alignleft" title="requirement_cartoon" src="http://nirmalsasidharan.files.wordpress.com/2011/07/requirement_cartoon.png?w=198&#038;h=322" alt="" width="198" height="322" /></a>Requirements Management is an evolving field and until recently never crossed company boundaries. With tighter collaboration between partner companies the benefits of applying RM across company borders became known. The field being highly dominated by commercial products gave barely any chance for standardization. A group of companies in the automotive field, realized that with such a diversity existing hardly any unification is possible. They gave birth to this generic requirements interchange format which was later adopted by OMG and standardized.</p>
<p>The generic structure of ReqIF allows companies to use the tools of their choice to do requirements management and use ReqIF as the standard exchange mechanism and even do round trips. ReqIF is not the only standard to allow this generic nature in the field of Requirements Engineering. DOORS, for example, has an extensible database allowing users to add/delete attributes. The changes to the schema are often communicated to the partners by external means to replicate the changes in their database. Since ReqIF carries the meta-information with it, the changes are migrated automatically across tools/company boundaries. Transmitting the meta-information in ReqIF could however be controlled by tooling. This nevertheless would beat the purpose of ReqIF.</p>
<p>It is also questionable, why such a generic model is required when we have metamodels like UML or EMF already available. The reason for this is very much the same as why EMF co-exists with UML. ReqIF is not a general purpose modeling language like UML or EMF, but more focused on requirements domain.</p>
<h2>Integrating ReqIF</h2>
<p>RMF provides ReqIF as an EMF based metamodel. This could be used by tool vendors as the internal tool model or an export model by means of model to model transformation. The provided loaders and serializers make sure that the ReqIF file is read/written according to the ReqIF XML Schema.</p>
<p>Using ReqIF natively brings all the advantages of ReqIF to the tooling as well. For example, ReqIF based tools could model the requirements domain of the company within the tooling and share it with partners along with the instance data.</p>
<h2>What next?</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_interest.png"><img class="alignright" title="rmf_interest" src="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_interest.png?w=244&#038;h=208" alt="" width="244" height="208" /></a>The initial code contribution is planned by early August 2011 and will be made available as soon as the IP review at Eclipse is complete. If you have any suggestions/comments about RMF, would like to contribute or like to be listed as an interested party, please provide it <a href="http://www.eclipse.org/forums/index.php/t/220570/">here</a>.</p>
<address>Images from <a href="http://www.FreeDigitalPhotos.net">FreeDigitalPhotos.net</a></address>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/reqif/'>ReqIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rif/'>RIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rmf-2/'>RMF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/797/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/797/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=797&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/07/18/requirements-modeling-framework-rmf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_at_work.png" medium="image">
			<media:title type="html">rmf_at_work</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_architecture1.png" medium="image">
			<media:title type="html">reqif_architecture</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/reqif_mm3.png" medium="image">
			<media:title type="html">reqif_mm</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/requirement_cartoon.png" medium="image">
			<media:title type="html">requirement_cartoon</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/07/rmf_interest.png" medium="image">
			<media:title type="html">rmf_interest</media:title>
		</media:content>
	</item>
		<item>
		<title>10 common EMF mistakes</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/05/25/10-common-emf-mistakes/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/05/25/10-common-emf-mistakes/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:09:23 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=729</guid>
		<description><![CDATA[1. Treating EMF generated code as only an initial code base EMF is a good startup kit for introducing MDSD (Model-Driven Software Development) in your project. Anyone who has been introduced to EMF and had their first code generated using EMF will for sure be impressed by the short turn around time needed to have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=729&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>1. Treating EMF generated code as only an initial code base</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/initial_code.png"><img class="alignleft size-full wp-image-733" title="initial_code" src="http://nirmalsasidharan.files.wordpress.com/2011/05/initial_code.png?w=595" alt=""   /></a>EMF is a good startup kit for introducing MDSD (Model-Driven Software Development) in your project. Anyone who has been introduced to EMF and had their first code generated using EMF will for sure be impressed by the short turn around time needed to have an initial version of your model based application up and running. For many, the thrill ends as soon as you need to change the behaviour of generated code and have to dig into it and understand it. It is complex, but only complex as any other similar sized framework. Many projects I have come across make a mistake at this point. They start treating the EMF generated code as an initial code base and start making it dirty by modifying it by hand. Adding <em>@generated NOT</em> tags in the beginning and not anymore later. At this point you part ways with &#8220;EMF way of doing things&#8221; and also with MDSD.</p>
<p>The customizations mostly start with the generated editor. This is quite acceptable as the editor is intended as an initial &#8220;template&#8221; and it expects you to customize it. However, this is not the case with model and edit projects. They have to be in sync with your model and this needs making some strong decisions, specifically &#8211;  &#8221;I will not touch the generated code&#8221;. Follow EMF recommended way of changing generated code or use <a href="http://nirmalsasidharan.wordpress.com/2011/05/18/extending-emf-itemproviders-using-google-guice-i/">Dependency Injection</a>.</p>
<h2>2. Model modification without EMF Commands</h2>
<p><img class="alignright size-medium wp-image-773" title="emf_model_modification" src="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_model_modification.png?w=162&#038;h=137" alt="" width="162" height="137" /></p>
<p>In EMF you deal a lot with model objects. Almost any UI selection operation hands over a model object to you. It is so easy to fall into the trap of changing the state of the model objects directly once you have access to it, either using the generated model API or using reflective methods. Problems due to such model updates are detected only later, mostly when Undo/Redo operations stops working as expected.</p>
<p>Use EMF Commands! Modify your model objects only using commands. Either directly using EMF commands, extending them or creating your own commands. When you need to club many operations as a single command use <a href="http://help.eclipse.org/help33/topic/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/common/command/CompoundCommand.html">CompoundCommand</a>s. Use <a href="http://help.eclipse.org/help33/topic/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/edit/command/ChangeCommand.html">ChangeCommand</a> when you are up to making a lot of model changes in a transactional way.</p>
<h2>3. Not reacting to notifications/Overuse of notifications</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/notification.png"><img class="alignleft size-full wp-image-730" title="notification" src="http://nirmalsasidharan.files.wordpress.com/2011/05/notification.png?w=595" alt=""   /></a>EMF notification is one the most powerful features of the framework. Any change to model objects are notified to anyone who is interested in knowing about it. Many projects decide to ignore listening to model changes and react to model changes by traversing the model again to look for changes or making assumptions about model changes and combining the behaviour into UI code.</p>
<p>When you want to react to a model change, don&#8217;t assume that you are the only one going to originate that change. Always listen to model changes and react accordingly. Don&#8217;t forget the handy <a href="http://help.eclipse.org/help33/topic/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/util/EContentAdapter.html">EContentAdapter</a> class.</p>
<p>On the contrary, some projects add a lot of listeners to listen to model changes without applying proper filters. This could greatly slow down your application.</p>
<h2>4. Forgetting EcoreUtils</h2>
<p><img class="alignright size-full wp-image-744" title="ecoreutil" src="http://nirmalsasidharan.files.wordpress.com/2011/05/ecoreutil.png?w=595" alt=""   /></p>
<p>Before writing your own utility functions, keep an eye on <a href="http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/util/EcoreUtil.html">EcoreUtils</a> class. Mostly, the generic function you are trying to implement is already there.</p>
<h2>5. Leaving Namespace URI as default</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/id.png"><img class="alignleft size-full wp-image-735" title="id" src="http://nirmalsasidharan.files.wordpress.com/2011/05/id.png?w=595" alt=""   /></a>When you create an Ecore model, EMF generates a default Prefix and Namespace URI for you. Mostly this is left as it is without realizing that this is the most important ID for your new model. Only when newer versions of the model needs to be released later, people start looking out for meaningful URIs.</p>
<p>Change the default to a descriptive one before generating code. For example, including some version information of the model.</p>
<h2>6. UI getting out of sync with model</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/binding.jpg"><img class="size-full wp-image-737 alignright" title="binding" src="http://nirmalsasidharan.files.wordpress.com/2011/05/binding.jpg?w=595" alt=""   /></a>The EMF generated editor makes use of Jface viewers. These viewers are always kept in sync using the generated ItemProviders. However these viewers cannot always satisfy the different UI requirements. You might have to use other SWT components or Eclipse forms. At this juncture, many implementors mix UI and model concerns together and in turn lose the sync between the model and UI.</p>
<p>Although, you could go ahead and implement your custom viewers, the easier way would be to use <a href="http://tomsondev.bestsolution.at/2009/06/06/galileo-emf-databinding-part-1/">EMF Databinding</a>.</p>
<h2>7. Relying on default identification mechanism</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/reference.png"><img class="alignleft size-full wp-image-739" title="reference" src="http://nirmalsasidharan.files.wordpress.com/2011/05/reference.png?w=595" alt=""   /></a>Every EMF object is identified by a Xpath like URI fragment.  For example, <em>//@orders.1/@items.</em>3. This is the default referencing mechanism within an EMF model or across models. If you look closely you could see that the default mechanism is based on feature names and indexes. The default implementation could turn dangerous if the index order changes and the references are not updated accordingly.</p>
<p>Extend this to uniquely identify your model object or simply assign an <em>intrinsic</em> ID to your model object. EMF will then use these IDs to reference your objects.</p>
<h2>8. Forgetting reflective behavior</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_reflection.png"><img class="size-full wp-image-741 alignright" title="emf_reflection" src="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_reflection.png?w=595" alt=""   /></a>Many consider the reflective features of EMF as an advanced topic. It is not as complex as it seems.</p>
<p>Instead of depending fully on generated APIs, think about creating generic reusable functions which makes use of the meta information every EObject carries. Have a look at the implementation of <a href="http://help.eclipse.org/help33/topic/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/util/EcoreUtil.html#copy(org.eclipse.emf.ecore.EObject)" target="_blank">EcoreUtil.copy</a> function to understand what I mean.</p>
<h2>9. Standalone? Why do I bother</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/standalone.jpg"><img class="alignleft size-medium wp-image-742" title="standalone" src="http://nirmalsasidharan.files.wordpress.com/2011/05/standalone.jpg?w=125&#038;h=180" alt="" width="125" height="180" /></a>A misunderstanding most people have is that EMF is Eclipse specific. EMF can well run outside Eclipse as &#8220;stand-alone&#8221; applications.</p>
<p>While developing applications based on EMF you should design your applications such that the core is not tied to Eclipse. This would allow your applications to be run even in a non OSGi server-side environment.</p>
<h2>10. Not reading the EMF bible</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_bible1.png"><img class="alignright size-full wp-image-762" title="emf_bible" src="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_bible1.png?w=595" alt=""   /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_bible.png"><br />
</a>This is the biggest mistake a new comer could make. The book is a must read for anyone who starts working with EMF.</p>
<p><a href="http://www.informit.com/store/product.aspx?isbn=9780321331885">Order</a> now (Hope this fetches me a beer at the next <a href="http://www.eclipsecon.org/">EclipseCON Europe</a> ;))</p>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/729/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/729/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=729&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/05/25/10-common-emf-mistakes/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/initial_code.png" medium="image">
			<media:title type="html">initial_code</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_model_modification.png?w=300" medium="image">
			<media:title type="html">emf_model_modification</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/notification.png" medium="image">
			<media:title type="html">notification</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/ecoreutil.png" medium="image">
			<media:title type="html">ecoreutil</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/id.png" medium="image">
			<media:title type="html">id</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/binding.jpg" medium="image">
			<media:title type="html">binding</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/reference.png" medium="image">
			<media:title type="html">reference</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_reflection.png" medium="image">
			<media:title type="html">emf_reflection</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/standalone.jpg?w=209" medium="image">
			<media:title type="html">standalone</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_bible1.png" medium="image">
			<media:title type="html">emf_bible</media:title>
		</media:content>
	</item>
		<item>
		<title>Extending EMF ItemProviders using Google Guice &#8211; I</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/05/18/extending-emf-itemproviders-using-google-guice-i/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/05/18/extending-emf-itemproviders-using-google-guice-i/#comments</comments>
		<pubDate>Wed, 18 May 2011 14:59:38 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[Guice]]></category>
		<category><![CDATA[ItemProvider]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=681</guid>
		<description><![CDATA[EMF ItemProvider is the most important middleman in EMF framework providing all of the interfaces needed for model objects to be viewed or edited. They adapt EMF objects by providing the following: 1. Content and label providers which enables model objects to be viewed in Eclipse viewers 2. Property source for model objects to make them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=681&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/middleman.png"><img class="size-full wp-image-695 alignright" title="middleman" src="http://nirmalsasidharan.files.wordpress.com/2011/05/middleman.png?w=595" alt=""   /></a>EMF ItemProvider is the most important middleman in EMF framework providing all of the interfaces needed for model objects to be viewed or edited. They adapt EMF objects by providing the following:</p>
<p>1. Content and label providers which enables model objects to be viewed in Eclipse viewers<br />
2. Property source for model objects to make them available in Eclipse Property View<br />
3. Commands for editing model objects<br />
4. Forwarding change notifications on to Eclipse viewers</p>
<p>EMF generates the ItemProviders for you assuming some defaults. Although the defaults work most of time, there are occasions where you would like to change these. You could make the changes directly in generated code and add <em>@generated NOT</em> annotations. However, by doing this you invite trouble from MDSD gurus. Because the principle says, &#8220;Don&#8217;t touch generated code!&#8221;. Ideally you would like to retain the generated ItemProviders as it is and extend them somehow with your changes.</p>
<p>The tutorial shows how to do this in an elegant way by using Dependency Injection (DI). We will use the EMF example of &#8220;Extended Library Model&#8221; to take us through this.</p>
<h2>Setup</h2>
<p>1. Create a new Eclipse workspace</p>
<p>2. Add the &#8220;EMF Extended Library Model Example&#8221; projects using &#8220;New Project Wizard&#8221;</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_extended_library_model.png"><img class="size-full wp-image-698 alignnone" title="emf_extended_library_model" src="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_extended_library_model.png?w=595" alt=""   /></a></p>
<p>3. Run the example projects and create a sample Library model</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/library_model_sample.png"><img class="alignnone size-full wp-image-700" title="library_model_sample" src="http://nirmalsasidharan.files.wordpress.com/2011/05/library_model_sample.png?w=595" alt=""   /></a></p>
<h2>Extending ItemProviders the EMF way</h2>
<p>The generated editor by default displays the title of Book in the tree editor. This is because of the default <em>getText()</em> implementation in <em>BookItemProvider</em>.</p>
<pre class="brush: java; title: ; notranslate">
  /**
   * This returns the label text for the adapted class.
   * &lt;!-- begin-user-doc --&gt;
   * &lt;!-- end-user-doc --&gt;
   * @generated
   */
  @Override
  public String getText(Object object)
  {
    String label = ((Book)object).getTitle();
    return label == null || label.length() == 0 ?
      getString(&quot;_UI_Book_type&quot;) : //$NON-NLS-1$
      getString(&quot;_UI_Book_type&quot;) + &quot; &quot; + label; //$NON-NLS-1$ //$NON-NLS-2$
  }
</pre>
<p>Lets say we want to change this such that the number of pages in the book is also displayed along with its title. You could do this by changing the generated code and adding the <em>@generated NOT</em> annotation.</p>
<pre class="brush: java; title: ; notranslate">
  /**
   * This returns the label text for the adapted class.
   * &lt;!-- begin-user-doc --&gt;
   * &lt;!-- end-user-doc --&gt;
   * @generated NOT
   */
  @Override
  public String getText(Object object)
  {
    String label = ((Book)object).getTitle() + &quot; (&quot; + ((Book) object).getPages() + &quot;) &quot;;
    return label == null || label.length() == 0 ?
      getString(&quot;_UI_Book_type&quot;) : //$NON-NLS-1$
      getString(&quot;_UI_Book_type&quot;) + &quot; &quot; + label; //$NON-NLS-1$ //$NON-NLS-2$
  }
</pre>
<p>If you now run the editor, the number of pages is displayed together with the book name.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension1.png"><img class="alignnone size-full wp-image-704" title="library_extension1" src="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension1.png?w=595" alt=""   /></a></p>
<p>This however breaks the <a href="http://heikobehrens.net/2009/04/23/generation-gap-pattern/">Generation Gap Pattern</a> in code generation.</p>
<h2>Extending ItemProviders by extension</h2>
<p>The cleaner approach is to extend the generated ItemProvider to include your changes. Now we have to also make sure that the tooling uses our customized ItemProvider. This is rather easy.</p>
<p>EMF ItemProviders are in fact EMF adapters. They provide some behavioural extensions to the modeled objects. The recommended way of creating adapters in EMF is using AdapterFactories. The ItemProviders are also created in this way, using the generated ItemProviderAdapterFactory, EXTLibraryItemProviderAdapterFactory in this example. You could override createXXXAdapter() methods to create an instance of your custom ItemProvider and register your extended ItemProviderAdapterFactory.</p>
<p>Lets first do this the traditional way (without DI).</p>
<p>1. Following the <a href="http://heikobehrens.net/2009/04/23/generation-gap-pattern/">Generation Gap Pattern</a> article by Heiko, you could change the<em> extlibrary.genmode</em>l to output the generated code in a <em>src-gen</em> folder of the edit plugin and put your extensions in <em>src</em> folder. In this tutorial, to further isolate our changes we create a new extension plugin, <em>org.eclipse.example.library.edit.extensio</em>n.</p>
<p>2. Create a new class <em>BookItemProviderExtension</em> which extends <em>BookItemProvider</em> within the new plugin.</p>
<pre class="brush: java; title: ; notranslate">
public class BookItemProviderExtension extends BookItemProvider {

	public BookItemProviderExtension(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	@Override
	public String getText(Object object) {
		return super.getText(object) + &quot; (&quot; + ((Book) object).getPages() + &quot;) &quot;;
	}

}
</pre>
<p>3. Create <em>EXTLibraryItemProviderAdapterFactoryExtension</em> which extends <em>EXTLibraryItemProviderAdapterFactory</em></p>
<pre class="brush: java; title: ; notranslate">
public class EXTLibraryItemProviderAdapterFactoryExtension extends
		EXTLibraryItemProviderAdapterFactory {

	@Override
	public Adapter createBookAdapter() {
	    if (bookItemProvider == null)
	    {
	      bookItemProvider = new BookItemProviderExtension(this);
	    }
	    return bookItemProvider;
	  }

}
</pre>
<p>4. Modify the editor code to use the new ItemProviderAdapterFactoryExtension</p>
<pre class="brush: java; title: ; notranslate">

public class EXTLibraryEditor extends MultiPageEditorPart
  implements
    IEditingDomainProvider,
    ISelectionProvider,
    IMenuListener,
    IViewerProvider,
    IGotoMarker
{
...
 protected void initializeEditingDomain()
	  {
	    // Create an adapter factory that yields item providers.
	    //
	    adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
	    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
	    adapterFactory.addAdapterFactory(new EXTLibraryItemProviderAdapterFactoryExtension());
	    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    	...
	}
	...
}

</pre>
<p>If you run the editor again, by including the new extension plugin you would get the same result as before.  With this step, we managed to isolate our changes to a new plugin.</p>
<h2>Extending ItemProviders using Google Guice</h2>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/guice1.png"><img class="size-medium wp-image-710 alignright" title="Guice" src="http://nirmalsasidharan.files.wordpress.com/2011/05/guice1.png?w=182&#038;h=300" alt="" width="182" height="300" /></a>Although, we managed to isolate our changes without changing the generated code, this might not be enough in the long run. What if</p>
<p>1. you need multiple ItemProvider implementations for the same EMF Object and want to switch between them<br />
2. you want to extend many ItemProviders in the inheritance hierarchy. For example, you need to change <em>PersonItemProvider</em> and <em>WriterItemProvider</em> (which extends <em>PersonItemProvider)</em>.</p>
<p>Although, you don&#8217;t need to use DI to solve these problems, DI would do it for you in a simpler, cleaner way. In this tutorial we will use Google Guice to achieve this. Google Guice is cool light weight dependency Injection framework. You could inject your dependencies just by writing few lines of code and some annotations. If you don&#8217;t like annotations, you could even use Guice without them. If you are not familiar with Google Guice read, <a href="http://code.google.com/p/google-guice/wiki/GettingStarted">Getting Started</a>.</p>
<p>Lets go ahead and &#8220;Guicify&#8221; our earlier example. We start with simple modifications and go on to detailed ones in later steps.</p>
<h3><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify1.png"><img class="size-full wp-image-722 alignleft" title="guicify1" src="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify1.png?w=595" alt=""   /></a></h3>
<p>1. Firstly, you need to add a dependency to Google Guice from our <em>org.eclipse.example.library.edit.extension</em> plugin.</p>
<blockquote><p>Google Guice is currently not publicly available as an eclipse plugin. There is a <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304793">bugzilla reques</a>t to add it to the Orbit bundle. It is however available with <a href="http://www.eclipse.org/Xtext/">Xtext</a> as an eclipse plugin. Since I have Xtext in my target, I use this in my tutorial. If you don&#8217;t have this, you need to add Google Guice as an external <a href="http://code.google.com/p/google-guice/downloads/list">jar</a> to your project.</p></blockquote>
<p>2. The next step would be to get rid of the &#8220;new&#8221; statements in the extended ItemProviderFactory. This is what binds the ItemProviderAdapterFactory to a specific ItemProvider implementation. We use Google Guice field injection to inject <em>BookItemProvider</em>.</p>
<pre class="brush: java; title: ; notranslate">

public class EXTLibraryItemProviderAdapterFactoryExtension extends
		EXTLibraryItemProviderAdapterFactory {

	@Inject
	protected BookItemProvider bookItemProvider;

	@Override
	public Adapter createBookAdapter() {
		return bookItemProvider;
	}

}

</pre>
<p>3. We now need to create a Google Guice Module to bind the extended ItemProvider. So go ahead and create a module as follows:</p>
<pre class="brush: java; title: ; notranslate">

public class LibraryModule extends AbstractModule implements Module{
	@Override
	protected void configure() {
		bind(BookItemProvider.class).to(BookItemProviderExtension.class).in(Scopes.SINGLETON);
	}

}

</pre>
<p>4. You could also inject the extended ItemProviderAdapterFactory into our editor. Since we don&#8217;t want the editor to have a Google Guice dependency, we make the following changes to the module and extended ItemProvider.</p>
<pre class="brush: java; title: ; notranslate">

public class LibraryModule extends AbstractModule implements Module{

	private final AdapterFactory adapterFactory;

	public LibraryModule(AdapterFactory adapterFactory) {
		this.adapterFactory = adapterFactory;
	}

	@Override
	protected void configure() {
		bind(AdapterFactory.class).toInstance(adapterFactory);
		bind(BookItemProvider.class).to(BookItemProviderExtension.class).in(Scopes.SINGLETON);
	}

}

</pre>
<pre class="brush: java; title: ; notranslate">

public class BookItemProviderExtension extends BookItemProvider {

	@Inject
	public BookItemProviderExtension(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	@Override
	public String getText(Object object) {
		return super.getText(object) + &quot; (&quot; + ((Book) object).getPages() + &quot;) &quot;;
	}

}

</pre>
<p>5. Now we need to create a Guice Injector.</p>
<pre class="brush: java; title: ; notranslate">

public class EXTLibraryItemProviderAdapterFactoryExtension extends
		EXTLibraryItemProviderAdapterFactory {

	public LibraryItemProviderAdapterFactoryExtension() {
		Guice.createInjector(new LibraryModule(this));
	}

	@Inject
	protected BookItemProvider bookItemProvider;

	@Override
	public Adapter createBookAdapter() {
		return bookItemProvider;
	}

}

</pre>
<p>6. Run it and you get the same result as before.</p>
<blockquote><p>You could now inject a different implementation of the ItemProvider by only creating a new binding in the module file.</p></blockquote>
<h3><span class="Apple-style-span" style="font-weight:normal;font-size:13px;"><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify2.png"><img class="alignleft size-full wp-image-723" title="guicify2" src="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify2.png?w=595" alt=""   /></a>That was a rather trivial example. Lets take a more significant example where we need to make changes to <em>PersonItemProvider</em> and <em>WriterItemProvider (</em>which extends <em>PersonItemProvider)</em>.</span></h3>
<p>The Extended Library Model example, by default displays the <em>Lastname</em> of the <em>Writer</em> for the attribute <em>Name</em>. This comes from the following lines of code in <em>PersonItemProvider</em>, the superclass of <em>WriterItemProvider</em>.</p>
<pre class="brush: java; title: ; notranslate">

  @Override
  public String getText(Object object)
  {
    String label = ((Person)object).getLastName();
    return label == null || label.length() == 0 ?
      getString(&quot;_UI_Person_type&quot;) : //$NON-NLS-1$
      getString(&quot;_UI_Person_type&quot;) + &quot; &quot; + label; //$NON-NLS-1$ //$NON-NLS-2$
  }

</pre>
<p>Lets change this to display the <em>Firstname</em> instead of  <em>Lastname</em>.</p>
<p>1. Create a new extension ItemProvider for <em>Person</em>, <em>PersonItemProviderExtension</em> and override the<em> getText()</em> method as follows</p>
<pre class="brush: java; title: ; notranslate">

public class PersonItemProviderExtension extends PersonItemProvider {

	@Inject
	public PersonItemProviderExtension(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	@Override
	public String getText(Object object) {
		String label = ((Person) object).getFirstName();
		return label == null || label.length() == 0 ? getString(&quot;_UI_Person_type&quot;) : //$NON-NLS-1$
				getString(&quot;_UI_Person_type&quot;) + &quot; &quot; + label; //$NON-NLS-1$ //$NON-NLS-2$

	}

}

</pre>
<p>2. Inject the extended <em>PersonItemProviderExtension</em> into the ItemProviderAdapterFactory extension.</p>
<pre class="brush: java; title: ; notranslate">

public class EXTLibraryItemProviderAdapterFactoryExtension extends
		EXTLibraryItemProviderAdapterFactory {
	...

	@Inject
	protected PersonItemProvider personItemProvider;

	@Override
	public Adapter createPersonAdapter() {
		return personItemProvider;
	}

}

</pre>
<p>3. Update the Google Guice Module</p>
<pre class="brush: java; title: ; notranslate">

	@Override
	protected void configure() {
		bind(AdapterFactory.class).toInstance(adapterFactory);
		bind(BookItemProvider.class).to(BookItemProviderExtension.class).in(Scopes.SINGLETON);
		bind(PersonItemProvider.class).to(PersonItemProviderExtension.class).in(Scopes.SINGLETON);
	}

</pre>
<blockquote><p>If you run the code now, you will see that we haven&#8217;t got the expected results yet. This is because, the <em>WriterItemProvider</em> still extends <em>PersonItemProvider</em> and not <em>PersonItemProviderExtension</em>, where we integrated the changes. We could go ahead and create a new <em>WriterItemProviderExtension</em> which extends <em>PersonItemProviderExtension</em>. But in this way we would tie the <em>WriterItemProviderExtension</em> to <em>PersonItemProviderExtension</em> implementation. We would like to inject each of these extensions without creating any inter-dependency between any of them.</p></blockquote>
<p>4. We can change inheritance to delegation and use injection again here, that is, inject <em>PersonItemProviderExtension</em> into <em>WriterItemProviderExtension </em>and delegate the <em>getText()</em> call.</p>
<blockquote><p>Changing inheritance to delegation however comes at the cost of some Java specific issues which I will talk about in a later part of my article.</p></blockquote>
<pre class="brush: java; title: ; notranslate">

public class WriterItemProviderExtension extends WriterItemProvider {

	@Inject
	private PersonItemProvider personItemProvider;

	@Inject
	public WriterItemProviderExtension(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	@Override
	public String getText(Object object) {
		return personItemProvider.getText(object);
	}

}

</pre>
<p>5. Don&#8217;t forget to update your <em>EXTLibraryItemProviderAdapterFactoryExtension</em> and Guice Module to bind <em>WriterItemProviderExtension</em>.</p>
<pre class="brush: java; title: ; notranslate">

public class EXTLibraryItemProviderAdapterFactoryExtension extends
		EXTLibraryItemProviderAdapterFactory {

	...

	@Inject
	protected WriterItemProvider writerItemProvider;

	@Override
	public Adapter createWriterAdapter() {
		return writerItemProvider;
	}

}

</pre>
<pre class="brush: java; title: ; notranslate">

	@Override
	protected void configure() {
		bind(AdapterFactory.class).toInstance(adapterFactory);
		bind(BookItemProvider.class).to(BookItemProviderExtension.class).in(Scopes.SINGLETON);
		bind(PersonItemProvider.class).to(PersonItemProviderExtension.class).in(Scopes.SINGLETON);
		bind(WriterItemProvider.class).to(WriterItemProviderExtension.class).in(Scopes.SINGLETON);
	}

</pre>
<p>If you run the code now, you will see that <em>FirstName</em> is displayed as <em>Name</em> attribute of <em>Writer</em>, instead of<em> Lastname</em>.</p>
<h3><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension2a.png"><img class="alignnone size-full wp-image-705" title="library_extension2a" src="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension2a.png?w=595" alt=""   /></a></h3>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify32.png"><img class="alignleft size-full wp-image-726" title="guicify3" src="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify32.png?w=595" alt=""   /></a>I will cover this in the second part of the tutorial. Hang on!</p>
<h2></h2>
<h2>Sources</h2>
<p><a href="http://dl.dropbox.com/u/1503450/org.eclipse.example.library.extension.zip">Download</a></p>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/guice/'>Guice</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/itemprovider/'>ItemProvider</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/681/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/681/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=681&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/05/18/extending-emf-itemproviders-using-google-guice-i/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/middleman.png" medium="image">
			<media:title type="html">middleman</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/emf_extended_library_model.png" medium="image">
			<media:title type="html">emf_extended_library_model</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/library_model_sample.png" medium="image">
			<media:title type="html">library_model_sample</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension1.png" medium="image">
			<media:title type="html">library_extension1</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/guice1.png?w=182" medium="image">
			<media:title type="html">Guice</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify1.png" medium="image">
			<media:title type="html">guicify1</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify2.png" medium="image">
			<media:title type="html">guicify2</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/library_extension2a.png" medium="image">
			<media:title type="html">library_extension2a</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/guicify32.png" medium="image">
			<media:title type="html">guicify3</media:title>
		</media:content>
	</item>
		<item>
		<title>Formal Requirement Specification with Xtext &amp; ProR</title>
		<link>http://nirmalsasidharan.wordpress.com/2011/05/17/formal-requirements-xtext-pror/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2011/05/17/formal-requirements-xtext-pror/#comments</comments>
		<pubDate>Tue, 17 May 2011 14:10:51 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[Requirements Management]]></category>
		<category><![CDATA[Xtext]]></category>
		<category><![CDATA[ProR]]></category>
		<category><![CDATA[ReqIF]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[RIF]]></category>
		<category><![CDATA[xtext]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=647</guid>
		<description><![CDATA[Requirements engineering is a critical yet difficult part of software development. Although a lot has been said and written about using formal methods in Requirements engineering, it is often not practiced. Systems requirements are mostly couched in very high level terms and made comprehensible to end users.  &#8221;Formal&#8221; Requirement Specifications almost always remains a myth or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=647&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Requirements engineering is a critical yet difficult part of software development. Although a lot has been said and written about using formal methods in Requirements engineering, it is often not practiced. Systems requirements are mostly couched in very high level terms and made comprehensible to end users.  &#8221;Formal&#8221; Requirement Specifications almost always remains a myth or a specialist thing. A good alternative here would be to use DSLs (Domain Specific Languages) for requirements specification. Or better mix DSLs with an standard requirements specification format like OMG <a href="http://www.omg.org/spec/ReqIF/">ReqIF</a>. A DSL offers the flexibility of fine tuning the specification language so that it is moderate enough for customers to understand and also for a specialist to process it.</p>
<p>To realize this and as a first step towards <a href="http://nirmalsasidharan.wordpress.com/2010/09/06/filling-the-void/">filling the void</a> I was talking about last year, a open source toolset has been developed by itemis in collaboration with <a href="http://www.stups.uni-duesseldorf.de/">Düsseldorf University</a> in the scope of <a href="http://www.itea-verde.org/">VERDE</a> project. The toolset consists of a OMG ReqIF based metamodel, a UI (named <a href="http://pror.org/">ProR</a>) to edit requirements in a DOORS like table view manner and an Xtext extension to integrate DSLs. The tutorial talks about the Xtext extension to ProR editor.</p>
<p>To see the tool in action have a look at the screencast by <a href="https://www.xing.com/profile/Oemer_Guersoy">Ömer Gürsoy</a>: <a href="http://www.guersoy.net/knowledge/crema">http://www.guersoy.net/knowledge/crema</a></p>
<p><strong><em>ProR with Xtext Inte</em>gration</strong></p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png"><img class="size-full wp-image-663 alignleft" title="pror_with_xtext" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png?w=595" alt=""   /></a></p>
<div>
<h2 id="Installation"></h2>
<h2><span style="font-size:small;"><span class="Apple-style-span" style="font-size:13px;font-weight:normal;"><span style="font-size:x-large;"><span class="Apple-style-span" style="font-size:20px;"><strong><br />
</strong></span></span></span></span></h2>
<h2>Installation</h2>
<ul>
<li>Install ProR from the ProR Update site: <a href="http://update.pror.org/"> http://update.pror.org</a></li>
<li>Select the &#8220;Xtext&#8221; feature while installing</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_updatesite.png"><img title="pror_xtext_updatesite" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_updatesite.png?w=600&#038;h=590" alt="" width="600" height="590" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_updatesite.png"><br />
</a></p>
<h2>Creating a formal language</h2>
<p>Please follow the <a href="http://www.eclipse.org/Xtext/documentation/1_0_0/xtext.html:"> Xtext Userguide</a> to learn how to create formal languages using Xtext</p>
<h2 id="IntegratingtheformallanguagetoProR">Integrating the formal language to ProR</h2>
<ul>
<li>Create a new Eclipse plugin Project</li>
<li>Add the following plug-in dependencies to the new project.</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_dependency.png"><img title="pror_xtext_dependency" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_dependency.png?w=600&#038;h=455" alt="" width="600" height="455" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_dependency.png"><br />
</a></p>
<p>The last two dependencies are the newly generated plugins for your language by Xtext</p>
<ul>
<li>Create a new extension for the extension point <tt>de.itemis.pror.presentation.xtext.configuration</tt>.</li>
<li><tt>language</tt> is the id of the newly created language.</li>
<li><tt>extension</tt> is the file extension of the newly created language<br />
<a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_extension.png"><img class="size-full wp-image-673 alignleft" title="pror_xtext_extension" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_extension.png?w=595" alt=""   /></a></li>
</ul>
<blockquote><p>Please note that this is not the project/plugin id but the language id<span class="Apple-style-span" style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"> </span></p></blockquote>
<p>For <tt>injector</tt>, implement the interface <tt>de.itemis.pror.presentation.xtext.core.IXtextInjector</tt> or extend <tt>de.itemis.pror.presentation.xtext.core.AbstractXtextInjector</tt>. The <tt>getInjector()</tt> method should return the Google injector of your Xtext language UI project. For example,</p>
<pre>public class DomainModelInjector extends AbstractXtextInjector {

	@Override
	public Injector getInjector() {
		return DomainmodelActivator.getInstance().
                               getInjector(getLanguage());
	}

}</pre>
<p>Please note that it might be necessary to export the <tt>*.ui.internal</tt> package from the UI project to access the <tt>XXX</tt>Activator instance as above. We will improve this as soon as Xtext makes the injector public in a different way.</p>
<h2 id="RunningProRwithformallanguageintegration">Running ProR with formal language integration</h2>
<ul>
<li>Launch the newly created plugins from your workspace which has ProR already in the target</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_plugins1.png"><img title="pror_xtext_plugins" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_plugins1.png?w=406&#038;h=179" alt="" width="406" height="179" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_plugins1.png"><br />
</a><br />
Needless to say, build the newly created plugins and add them to the ProR target after testing</p>
<ul>
<li>Create a new RIF file in ProR</li>
<li>Follow ProR documentation and create a datatype for the newly created language. In the example below we use an existing datatype in ProR, <tt>T_String32k</tt></li>
<li>Create a new Presentation Configuration.</li>
<li>For <tt>Language</tt> enter the Language id of you new language as before</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation1.png"><img title="pror_xtext_presentation1" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation1.png?w=500&#038;h=600" alt="" width="500" height="600" /></a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation1.png"><br />
</a></p>
<ul>
<li>For <tt>Presentation Datatype</tt>, select an existing datatype. <tt>T_String32k</tt> in the example below</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation2.png"><br />
</a><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation2.png"><img title="pror_xtext_presentation2" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation2.png?w=500&#038;h=600" alt="" width="500" height="600" /></a></p>
<ul>
<li>Double click on the requirement attribute which is linked to the new datatype in the ProR grid. <tt>Description</tt> in the example below.</li>
<li>A pop-up dialog opens up with a full-fledged editor for the newly created language. The editor supports most Xtext features like syntax highlighting, auto completion, error highlighting etc.</li>
</ul>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png"><img class="alignleft size-full wp-image-663" title="pror_with_xtext" src="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png?w=595" alt=""   /></a></p>
<ul>
<li>Enter your formal description in the editor</li>
<li>Click on a different cell to accept the new value</li>
<li>Save the file to persist the contents as usual</li>
</ul>
</div>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/pror/'>ProR</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/reqif/'>ReqIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/requirements/'>requirements</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/rif/'>RIF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/xtext-2/'>xtext</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/647/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/647/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=647&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2011/05/17/formal-requirements-xtext-pror/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png" medium="image">
			<media:title type="html">pror_with_xtext</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_updatesite.png" medium="image">
			<media:title type="html">pror_xtext_updatesite</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_dependency.png" medium="image">
			<media:title type="html">pror_xtext_dependency</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_extension.png" medium="image">
			<media:title type="html">pror_xtext_extension</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_plugins1.png" medium="image">
			<media:title type="html">pror_xtext_plugins</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation1.png" medium="image">
			<media:title type="html">pror_xtext_presentation1</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_xtext_presentation2.png" medium="image">
			<media:title type="html">pror_xtext_presentation2</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2011/05/pror_with_xtext.png" medium="image">
			<media:title type="html">pror_with_xtext</media:title>
		</media:content>
	</item>
		<item>
		<title>(e)Wiki &#8211; A model based Wiki framework</title>
		<link>http://nirmalsasidharan.wordpress.com/2010/10/20/ewiki-a-model-based-wiki-framework/</link>
		<comments>http://nirmalsasidharan.wordpress.com/2010/10/20/ewiki-a-model-based-wiki-framework/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 10:47:46 +0000</pubDate>
		<dc:creator>Nirmal Sasidharan</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[EMF]]></category>
		<category><![CDATA[Mylyn]]></category>
		<category><![CDATA[WikiText]]></category>

		<guid isPermaLink="false">http://nirmalsasidharan.wordpress.com/?p=522</guid>
		<description><![CDATA[1. What&#8217;s Wiki with a (e)? (e)Wiki is a Wiki markup generation framework based on Mylyn WikiText and EMF. The framework allows to read and write different Wiki markup formats &#8211; this time, the model driven way. If you have an existing model based tool chain, the framework could easily fit in there to generate some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=522&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h2>1. What&#8217;s Wiki with a (e)?</h2>
<p>(e)Wiki is a Wiki markup generation framework based on <a href="http://wiki.eclipse.org/Mylyn/Incubator/WikiText">Mylyn WikiText</a> and <a href="http://www.eclipse.org/modeling/emf/">EMF</a>. The framework allows to read and write different Wiki markup formats &#8211; this time, the model driven way. If you have an existing model based tool chain, the framework could easily fit in there to generate some quick documentation, without worrying about markups. You could reuse all the WikiText markup parsers and document builders, combined with the power of EMF features like EMF persistence, EMF notification etc.</p>
<p>The framework was developed as part of a customer project to generate Wiki documentation out of EMF based domain models. The framework is currently not open sourced and made available to public. Talks are on with the customer on this however.</p>
<p>The article gives an overview about the framework and its features. The intention of the article is also to demonstrate the extensibility of two powerful Eclipse frameworks - Mylyn WikiText and EMF.</p>
<h2>2. Architecture</h2>
<p>(e)Wiki is an addon to Mylyn WikiText. WikiText is a framework which supports parsing/editing Wiki markup formats like MediaWiki, Textile, Confluence, TracWiki and TWiki and writing them as HTML, Eclipse Help, <a title="http://www.docbook.org" rel="nofollow" href="http://www.docbook.org/">DocBook</a>, <a title="http://dita.xml.org" rel="nofollow" href="http://dita.xml.org/">DITA</a> and <a title="http://en.wikipedia.org/wiki/XSL_Formatting_Objects" rel="nofollow" href="http://en.wikipedia.org/wiki/XSL_Formatting_Objects">XSL-FO</a>. WikiText however doesn&#8217;t have an internal data model for documents (like DOM for XML). (e)Wiki adds this missing layer to the WikiText framework. Instead of using a POJO data model, (e)Wiki uses a powerful EMF based metamodel. Using (e)Wiki you could read all the above markup formats and generate a (e)WikiModel based on EMF. The model could then be written out using any of the WikiText document builders.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_architecture1.png"></a><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_architecture1.png"><img title="eWiki_architecture" src="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_architecture1.png?w=600&#038;h=269" alt="" width="600" height="269" /></a></p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_architecture.png"></a></p>
<h2>3. (e)WikiModel</h2>
<p>(e)WikiModel is an EMF based Wiki metamodel. It is a generic metamodel for any Wiki Language.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_model.png"><img title="eWiki_Model" src="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_model.png?w=717&#038;h=405" alt="" width="717" height="405" /></a></p>
<p style="text-align:center;"><em>(Only partial model is shown above)</em></p>
<p>(e)WikiModel is not aimed to be used as a DSL for your domain. It is intended to capture the documentation aspects of your domain model. To better describe semantic information use a DSL of your own using a framework like <a href="http://www.eclipse.org/Xtext/">Xtext</a>.</p>
<h2>4. Features</h2>
<p>(e)Wiki currently delivers the following:</p>
<ul>
<li>A metamodel for Wiki called (e)WikiModel</li>
<li>(e)WikiEditor to view/edit (e)Wiki files</li>
<li>Previewing of rendered (e)Wiki content</li>
<li>UI extensions to convert existing markups to (e)WikiModel</li>
<li>Generating <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Textile</a> and <a href="http://www.redmine.org/">Redmine</a> markup (together with HTML and Docbook as already supported by WikiText)</li>
<li>Feature to split generated Textile and Redmine markup files into subpages</li>
<li>Add Table of Contents to generated output</li>
</ul>
<h2>5. Working with (e)Wiki</h2>
<h2>5.1. Creating a (e)WikiModel</h2>
<p>A (e)Wiki instance could be created either from Eclipse UI or programatically.</p>
<h2>5.1.1. Creating from UI</h2>
<p>Create a markup file within the eclipse workspace.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/sample_textile.png"><img title="sample_textile" src="http://nirmalsasidharan.files.wordpress.com/2010/10/sample_textile.png?w=600&#038;h=337" alt="" width="600" height="337" /></a></p>
<p>Right click the markup file and invoke <em>eWiki -&gt; Generate eWiki.</em></p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_ewiki1.png"></a><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_ewiki1.png"><img title="generate_ewiki" src="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_ewiki1.png?w=480&#038;h=534" alt="" width="480" height="534" /></a></p>
<p>An (e)Wiki file is created in the same folder as selected file with extension <em>.ewiki</em>.</p>
<h2>5.1.2. Creating with code</h2>
<p>WikiText is based on &#8220;Builder&#8221; design pattern. (e)Wiki uses the same pattern and adds a new <em>DocmentBuilder</em>, the <em>EWikiDocumentBuilder</em>. The snippet below shows how to convert existing markup (Textile in this case) to (e)Wiki.</p>
<pre class="brush: java; title: ; notranslate">

final String markup = &quot;h1. Quisque&quot;

final ResourceSet resourceSet = new ResourceSetImpl();
final Resource eWikiResource = resourceSet.createResource (URI.createFileURI(&quot;...&quot;));

MarkupParser parser = new MarkupParser();
parser.setMarkupLanguage(new TextileLanguage());
EWikiDocumentBuilder eWikiDocumentBuilder = new EWikiDocumentBuilder(eWikiResource);
parser.setBuilder(eWikiDocumentBuilder);
parser.parse(markup);

eWikiResource.save(Collections.EMPTY_MAP);

</pre>
<p>The snippet below shows how to create a (e)WikiModel using model APIs. If you have worked with EMF generated model API code, this is no different, except that (e)Wiki adds additional convenient factory methods.</p>
<pre class="brush: java; title: ; notranslate">
final ResourceSet resourceSet = new ResourceSetImpl();
final Resource eWikiResource = resourceSet.createResource (URI.createFileURI(&quot;...&quot;));
Document document = EwikiFactory.eINSTANCE.createDocument();
document.setTitle(&quot;Lorem ipsum&quot;);

EwikiFactory.eINSTANCE.createHeading(document, 1, &quot;Quisque&quot;);

Paragraph paragraph = EwikiFactory.eINSTANCE.createParagraph();
document.getSegments().add(paragraph);
EwikiFactory.eINSTANCE.createText(paragraph, &quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&quot;);

BullettedList bullettedList = EwikiFactory.eINSTANCE.createBullettedList();
document.getSegments().add(bullettedList);
EwikiFactory.eINSTANCE.createListItem(bullettedList,&quot;Mauris&quot;);
EwikiFactory.eINSTANCE.createListItem(bullettedList,&quot;Etiam&quot;);

eWikiResource.getContents().add(document);
eWikiResource.save(Collections.EMPTY_MAP);
</pre>
<h2>5.2. (e)WikiEditor</h2>
<p>The (e)WikiEditor provides a tree based editor and a preview tab.</p>
<h2>5.2.1. Tree editor tab</h2>
<p>The tree editor provides a tree view of the (e)Wiki file. Although the editor could be used to change the file, it is rare that rich text would be edited in this way.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_editor1.png"></a><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_editor1.png"><img title="ewiki_editor" src="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_editor1.png?w=600&#038;h=527" alt="" width="600" height="527" /></a></p>
<h2>5.2.2. Preview tab</h2>
<p>The preview tab provides a preview of the (e)Wiki file as rendered by your default browser.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_preview1.png"><img title="ewiki_preview" src="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_preview1.png?w=655&#038;h=380" alt="" width="655" height="380" /></a></p>
<p>&nbsp;</p>
<h2>5.3. Generating output</h2>
<p>The (e)Wiki file could be converted to HTML, Docbook, Textile and Redmine markup formats.</p>
<h2>5.3.1. Generating output from UI</h2>
<p>Right clicking the (e)Wiki file brings up the context menu for conversions.</p>
<p><a href="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_html.png"><img title="generate_html" src="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_html.png?w=480&#038;h=514" alt="" width="480" height="514" /></a></p>
<h2>5.3.2. Generating output from Code</h2>
<p>You could use any of the existing <em>DocumentBuilder</em>s in WikiText to generate output from a (e)WikiModel. The snippet below shows how to convert an (e)Wiki instance to HTML programatically using the WikiText <em>HTMLDocumentBuilder</em>.</p>
<pre class="brush: java; title: ; notranslate">
final IFile eWikiFile = ...;
ResourceSet resourceSet = new ResourceSetImpl();
final Resource wikiResource = resourceSet.getResource(URI.createFileURI(eWikiFile.getRawLocation().toOSString()), true);
StringWriter writer = new StringWriter();

EWikiParser parser = new EWikiParser();
parser.setMarkupLanguage(new EWikiLanguage());
parser.setBuilder(new HTMLDocumentBuilder(writer));
parser.parse(wikiResource);

final String htmlContent = writer.toString();
</pre>
<div></div>
<br /> Tagged: <a href='http://nirmalsasidharan.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/emf/'>EMF</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/mylyn/'>Mylyn</a>, <a href='http://nirmalsasidharan.wordpress.com/tag/wikitext/'>WikiText</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nirmalsasidharan.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nirmalsasidharan.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nirmalsasidharan.wordpress.com&#038;blog=15543098&#038;post=522&#038;subd=nirmalsasidharan&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nirmalsasidharan.wordpress.com/2010/10/20/ewiki-a-model-based-wiki-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/6b9855aa15ae2418ef554acff06740a4?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">nirmal</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_architecture1.png" medium="image">
			<media:title type="html">eWiki_architecture</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_model.png?w=1024" medium="image">
			<media:title type="html">eWiki_Model</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/sample_textile.png" medium="image">
			<media:title type="html">sample_textile</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_ewiki1.png" medium="image">
			<media:title type="html">generate_ewiki</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_editor1.png" medium="image">
			<media:title type="html">ewiki_editor</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/ewiki_preview1.png?w=1024" medium="image">
			<media:title type="html">ewiki_preview</media:title>
		</media:content>

		<media:content url="http://nirmalsasidharan.files.wordpress.com/2010/10/generate_html.png" medium="image">
			<media:title type="html">generate_html</media:title>
		</media:content>
	</item>
	</channel>
</rss>
