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

<channel>
	<title>Modular Mind &#187; eclipse</title>
	<atom:link href="http://www.modumind.com/category/eclipse/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Fri, 08 Feb 2013 23:06:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>RCP Best Practices &#8211; Get your product building right away</title>
		<link>http://www.modumind.com/2012/11/12/rcp-best-practices-get-your-product-building-right-away/</link>
		<comments>http://www.modumind.com/2012/11/12/rcp-best-practices-get-your-product-building-right-away/#comments</comments>
		<pubDate>Mon, 12 Nov 2012 15:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1793</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>Putting it all together</h2>
<p>In this Getting Started section I&#8217;ve tried to lay out how to put together the initial pieces of an RCP application. The last step is to create a build that can be incorporated into a continuous integration process. This should be done immediately when you start any new project, and the build should run every time a code change is checked in.</p>
<p>The details of setting up a <a href="http://eclipse.org/tycho/documentation.php"/>Tycho build</a> and a <a href="http://wiki.eclipse.org/Hudson-ci">Hudson server</a> are beyond the scope of this post, and I would suggest you check out the appropriate documentation to get started. What I can offer, though, is a set of sample projects that reflect the best practices I&#8217;ve discussed so far. You should be able to import these projects and get a Tycho build running fairly quickly.</p>
<p><a href="/downloads/rcp-example-20121112.zip">Download sample RCP projects</a></p>
<h2>The sample projects</h2>
<p>Below you see the sample projects that reflect the structure and naming conventions discussed in previous posts. Each project also contains a Maven POM that describes how the project should be built. By the way, these projects target Eclipse 3.8, but you could easily use the same approach to create an RCP 4 application.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/sample-projects.png" alt="" title="sample-projects" width="550" height="785" class="alignnone size-full wp-image-1795" /></p>
<p>Notice that the product configuration file lives in its own project ending in <code>.repository</code>. The POM in this project causes a p2 repository to be created during the build. There is also an additional request to <em>materialize</em> the product as an archive that could be extracted on an end-user&#8217;s machine. This addition step is optional, as we often want to simply generate a p2 repository during the build.</p>
<h2>Running the build</h2>
<p>After installing Maven 3, you can open a terminal and navigate to the <code>com.modumind.sampleapp.build</code> folder in your workspace. This project contains the parent POM that launches the build. Run a <code>mvm clean package</code> command and you should see the following output indicating that the build ran successfully.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/sample-projects-console.png" alt="" title="sample-projects-console" width="550" height="446" class="alignnone size-full wp-image-1796" /></p>
<h2>Examining the results</h2>
<p>After the build runs, refresh the <code>com.modumind.simpleapp.repository</code> project. The build has created a <code>target</code> folder containing the build output. The <code>repository</code> subfolder contains a p2 repository and the <code>products</code> folder contains materialized archives.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/sample-projects-output.png" alt="" title="sample-projects-output" width="550" height="544" class="alignnone size-full wp-image-1798" /></p>
<p>In a continuous integration process, the repository could be copied to a server and made available to end-users or other developers creating downstream features.</p>
<h2>Final thoughts</h2>
<p>I hope you find the sample projects useful in creating new RCP applications or refactoring old ones. I&#8217;m also hoping that these projects will convince you to set up a continuous build using Tycho and Hudson, if you have not done this already. There are so many moving pieces in an RCP application that a continuous build is essential to finding problems as soon as they are introduced.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F12%2Frcp-best-practices-get-your-product-building-right-away%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Get%20your%20product%20building%20right%20away" id="wpa2a_2">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/11/12/rcp-best-practices-get-your-product-building-right-away/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Always run code using a product configuration</title>
		<link>http://www.modumind.com/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/</link>
		<comments>http://www.modumind.com/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/#comments</comments>
		<pubDate>Thu, 08 Nov 2012 16:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1763</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>How hard is it to run an application?</h2>
<p>As Eclipse RCP developers, we&#8217;re always running our applications in the Eclipse IDE. We make a change, we run the code, make another change, run the code again. This shouldn&#8217;t be a hard thing to do, and in general it isn&#8217;t. But RCP apps do present some unique challenges in this area.</p>
<p>In Eclipse, we always run code using a <em>run configuration</em>. These configurations specify various details of what to run and how to run it. For example, to run an RCP application we need to specify:</p>
<ul>
<li>The application or product to run, specified by its id</li>
<li>The set of bundles that should be available at runtime</li>
<li>Bundle configuration details such as start-levels</li>
<li>Bundle locations, in particular whether a bundle is in your workspace or in the target platform</li>
<li>Launch arguments</li>
<li>Miscellaneous other details, such as tracing configuration</li>
</ul>
<p>That&#8217;s a lot to specify, but luckily we don&#8217;t have to do this by hand. The PDE tooling is smart enough to generate these run configurations for us. Unfortunately, the ways in which this is done can introduce other complications. If you&#8217;re interested in the details, check out <a href="/2009/09/03/run-configurations-and-eclipse-rcp/">this post</a> I wrote a while back.</p>
<h2>Creating a run configuration</h2>
<p>The best way to generate a run configuration for an RCP application is to use a product configuration file. In this file we specify all of the information listed above on the various tabs of the editor. Of course, the set of bundles will actually be specified by listing features, as I discussed earlier. Finally, the run configuration itself is created when you click on the <strong>Launch an Eclipse application</strong> link on the <strong>Overview</strong> tab of the Product Configuration editor.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/running-from-product.png" alt="" title="running-from-product" width="550" height="496" class="alignleft size-full wp-image-1779" /></p>
<p>Once you create the run configuration, you can run it again by clicking the <strong>Run</strong> button on the toolbar.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/running-from-toolbar.png" alt="" title="running-from-toolbar" width="550" height="141" class="alignleft size-full wp-image-1781" /></p>
<p>It&#8217;s important to understand the difference between running from the link and running using the toolbar button. Running from the link will <em>re-generate</em> the run configuration from the current state of the product and then run the application. If you manually make changes to the run configuration (e.g. add a launch argument) and then run using the link, your changes will get overwritten. Running from the toolbar simply runs the latest version of the run configuration.</p>
<h2>Fully leveraging the product configuration</h2>
<p>Product configurations are extremely useful because they capture in one place all of the little details necessary to run and build your application. This dual role of product configurations is the key to using them successfully.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/10/Product-Configurations.png" alt="" title="Product-Configurations" width="463" height="297" class="alignnone size-full wp-image-1732" /></p>
<p>To fully leverage product configurations you should <em>always run your code using the link on the <strong>Overview</strong> tab of the Product Configuration editor</em>. Doing this <em>guarantees</em> that what you run  in the IDE matches exactly what you&#8217;ll get in the build &#8211; the list of bundles, start-levels, launch arguments, everything.</p>
<p>Running using the toolbar button often results in using stale configuration information. Even worse, manually modifying the run configuration introduces configuration details that will never make it into the build. For example, many developers go into their run configuration and click the <strong>Add Required Plug-ins</strong> button. This fixes the problem at hand (getting the app to run in the IDE) but results in an invalid build configuration.</p>
<h2>Final thoughts</h2>
<p>Running using the link may seem a little awkward at first, but I can tell you from experience that it will save you many hours of frustration. I&#8217;ve mentored many RCP developers and run configurations are one of the most common source of problems. Almost always, the problem could have been avoided if the developer was consistently generating run configurations from the product.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F08%2Frcp-best-practices-always-run-code-using-a-product-configuration%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Always%20run%20code%20using%20a%20product%20configuration" id="wpa2a_4">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Remove versions from product dependencies</title>
		<link>http://www.modumind.com/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/</link>
		<comments>http://www.modumind.com/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/#comments</comments>
		<pubDate>Tue, 06 Nov 2012 15:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1766</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>The problem with feature versions in products</h2>
<p>There are many places in an Eclipse RCP application where version constraints can be used. We can constrain bundle dependencies as well as feature dependencies, and it&#8217;s important to make proper use of these constraints. But occasionally we may create constraints that are not very useful, and in my opinion this is the case with product dependencies.</p>
<p>First, when you add a feature to a product configuration on the <strong>Dependencies</strong> page of the editor, the current version of that feature is recorded.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/product-feature-version.png" alt="" title="product-feature-version" width="550" height="369" class="alignleft size-full wp-image-1771" /></p>
<p>If you leave the feature version as it is, this is the <em>only</em> version of that feature which will work with your product. In this case, for example, if you upgrade your target platform to reference RCP 4.2.2 (when it comes out), your product will break.</p>
<p>Your product build will fail because of the unresolved version constraint. Also, if you&#8217;re running in the IDE using the link on the <strong>Overview</strong> page of the product configuration editor, your application will crash with a not very helpful error message.</p>
<pre class="crayon:false font-size:8">
<span class="inner-pre" style="font-size: 10px">
!SESSION Thu Nov 01 10:30:49 PDT 2012 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2012-11-01 10:30:49.026
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
</span>
</pre>
<h2>Removing feature version constraints</h2>
<p>The solution is to remove these feature version constraints. This is easily done in the editor by selecting the recently added feature and clicking the <strong>Properties</strong> button on the right. Then simply select the entire version text and delete it.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/product-version-removed.png" alt="" title="product-version-removed" width="550" height="369" class="alignleft size-full wp-image-1773" /></p>
<p>Your product will now build and run with whatever feature version that is available in the target platform.</p>
<h2>So where do the versions go?</h2>
<p>You may be thinking that by removing these version constraints we&#8217;re opening the door to future problems. That&#8217;s a very good thought to have, as managing feature dependencies can be a complicated business. Remember, though, that product configurations are about <em>building</em> things. The purpose of these feature versions is to create a <em>reproducible</em> build against a specific feature set.</p>
<p>In my opinion, the best way to achieve this is to specify the feature versions in the <em>target definition</em> file to be used in the build. These target definition files can be checked in to a VCS, tagged and branched to your hearts content. This allows for repeatable builds against a specific set of feature versions without the hassle of hard coding the versions in the product.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F06%2Frcp-best-practices-remove-versions-from-product-dependencies%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Remove%20versions%20from%20product%20dependencies" id="wpa2a_6">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Define products with feature based dependencies</title>
		<link>http://www.modumind.com/2012/11/01/rcp/</link>
		<comments>http://www.modumind.com/2012/11/01/rcp/#comments</comments>
		<pubDate>Thu, 01 Nov 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1737</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>Features and Plug-ins</h2>
<p>As I mentioned in the last post, setting up a product configuration is one of the first things you should be doing when starting a new Eclipse RCP application. When you set up this product configuration you have a choice in how you define the product dependencies, meaning the set of the <em>things</em> that will be built and deployed with the product. Our choices here are <em>plug-ins</em> and <em>features</em>.</p>
<p>This choice is made on the <strong>Overview</strong> page of the Product Configuration editor, as you can see below.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/11/product-features-plugins.png" alt="" title="product-features-plugins" width="550" height="392" class="alignleft size-full wp-image-1741" /></p>
<p>Features are simply a way of referring to a set of plug-ins (I actually prefer the OSGi term <em>bundles</em>, but we&#8217;ll use plug-ins for now). So either way we&#8217;re defining a set of plug-ins that make up the product. So, you might ask, what&#8217;s the difference?</p>
<h2>Features are the key to good RCP architecture</h2>
<p>The proper use of features is a critical best practice that is essential to any non-trivial RCP application. This is especially true when you want to leverage the modularity of RCP in an enterprise of commercial setting. Any time you&#8217;re deploying varying sets of artifacts to different users or customers, features will be the mechanism that makes this work.</p>
<p>We&#8217;ll get into much more detail about features in later posts, but here is a short summary of why features are important.</p>
<ul>
<li><em>Features provide an isolation layer so that you don&#8217;t need to depend on specific plug-ins.</em> For example, each version of RCP is defined as a varying set of plug-ins &#8211; some are added, others are removed. If your product configuration simply depends on the feature <code>org.eclipse.rcp</code>, then you don&#8217;t have to worry about this. If you depend on the specific plug-ins, your product definition may break when you migrate to a new version of RCP</li>
<li><em>Features are the unit of reuse.</em> I&#8217;m not sure how much grief I&#8217;m going to get for this, but I&#8217;ve come to the conclusion over the last few years that not only classes but plug-ins as well are too fine-grained to be an effective unit of reuse. From an architectural stand-point, it&#8217;s best to think of assembling our products from sets of features. I&#8217;ll come back to this in the future, but for now I&#8217;ll just say that it&#8217;s well worth spending time thinking hard about your feature definitions and how they may be used in a variety of situations.</li>
</ul>
<h2>Final thoughts</h2>
<p>When you first create a new product, the default configuration is based on plug-ins. Change this right away. Initially, your product will be based on the <code>org.eclipse.rcp</code> feature and also your own feature which contains a single plug-in. From there you can start to build up your own features and add additional third-party features as required.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F11%2F01%2Frcp%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Define%20products%20with%20feature%20based%20dependencies" id="wpa2a_8">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/11/01/rcp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Create a product configuration</title>
		<link>http://www.modumind.com/2012/10/30/rcp-best-practices-create-a-product-configuration/</link>
		<comments>http://www.modumind.com/2012/10/30/rcp-best-practices-create-a-product-configuration/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1729</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>What is a product configuration file?</h2>
<p>The product configuration file is kind of a strange animal. While not used at runtime, it is extremely important and we should learn to this file appropriately. Part of the confusion surrounding product configuration files (and the products that they define) is that they define multiple somewhat unrelated types of information.</p>
<ul>
<li><em>Dependencies</em> &#8211; The set of features or bundles that should get shipped as part of a build. This is a subset of the features and bundles available in the current workspace and target platform.</li>
<li><em>Launch arguments</em> &#8211; The arguments that should be passed to the executable on startup. These may include Eclipse arguments or JVM arguments.</li>
<li><em>Configuration</em> &#8211; Generally, things that go into the <code>config.ini</code> file. For example, specifying bundle start levels.</li>
<li><em>Branding</em> &#8211; Splash screens, launcher names, About window images and text, etc.</li>
</ul>
<p>So what ties all of this information together? The best way to understand product configuration files is to look at how they are <em>used</em>.</p>
<h2>Using product configuration files</h2>
<p>There are two uses for a product configuration file, and these two uses can be looked at as being two sides of the same coin.</p>
<p><img src="http://www.modumind.com/wp-content/uploads/2012/10/Product-Configurations.png" alt="" title="Product-Configurations" width="463" height="297" class="alignleft size-full wp-image-1732" /></p>
<p>Production configuration files allow us to <em>build a set of branded and configured artifacts</em> that can be packages as an archive or published to a p2 repository. This can be done either using the <strong>Eclipse Product export wizard</strong> link on the <strong>Overview</strong> of the Product Configuration editor or using a Tycho headless build. In either case, the dependencies, launching arguments, configuration settings and branding elements will be combined to produce the output.</p>
<p>Product configuration files also allow us to <em>run our code in the Eclipse IDE</em>. This is done by clicking on the <strong>Launch an Eclipse application</strong> link on the <strong>Overview</strong> tab of the Product Configuration editor. In this case, the dependencies, launching arguments, configuration settings and branding elements are combined to produce a <em>run configuration</em> that defines how your code is executed in the IDE.</p>
<p>As we&#8217;ll explore in future posts, it&#8217;s the <em>equivalence</em> of these two actions that is the key. Our goal is to always make sure that what we are running in the IDE is <em>exactly equivalent</em> to what we are building. Proper use of product configuration and target definition files provides us with this equivalence.</p>
<h2>Creating a product configuration</h2>
<p>There&#8217;s not too much to creating a product configuration file. There is a Product Configuration Wizard that creates the file and a Product Configuration Editor which allows us modify the underlying XML. Like target definitions, the product configuration file should live in it&#8217;s own project (<strong>General > Project</strong> in the New Project Wizard). This is a Maven Tycho requirement.</p>
<p>The name of this project should be something like:</p>
<ul>
<li><code>com.modumind.myapp.<em>repository</em></code></li>
<li><code>com.modumind.myapp.<em>p2</em></code></li>
<li><code>com.modumind.myapp.<em>updatesite</em></code></li>
</ul>
<p>The reason for this is that the Tycho output for this project is actually a p2 repository. As we&#8217;ll see later on, we can also build individual features, and they will also have a similar project that outputs the repository</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F30%2Frcp-best-practices-create-a-product-configuration%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Create%20a%20product%20configuration" id="wpa2a_10">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/30/rcp-best-practices-create-a-product-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Mirror Eclipse repositories</title>
		<link>http://www.modumind.com/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/</link>
		<comments>http://www.modumind.com/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/#comments</comments>
		<pubDate>Thu, 25 Oct 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1696</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<p>When setting up a target platform, it&#8217;s a good idea to insulate yourself from dependencies on outside servers. Many organizations currently create internal Maven repositories to perform this same role. For Eclipse RCP development, this insulation takes the form of partial mirrors of p2 repositories hosted at the Eclipse Foundation and perhaps elsewhere.</p>
<h2>Creating a mirror</h2>
<p>Creating a mirror is fairly straightforward. There is a p2 Ant task that can be used to create the mirror (a complete list of p2 Ant tasks can be found <a href="http://wiki.eclipse.org/Equinox/p2/Ant_Tasks">here</a>). These Ant tasks are special in that they need to be run via the Eclipse <em>antRunner</em> application. This means that you&#8217;ll need a full installation of Eclipse on the machine that will run the task.</p>
<p>So here is a simple Ant script that will mirror the Eclipse 3.8 Platform SDK.</p>
<p></p><pre class="crayon-plain-tag">&lt;project name=&quot;Create Mirror&quot; default=&quot;create-mirror&quot; basedir=&quot;.&quot;&gt;

	&lt;property name=&quot;target.dir&quot; value=&quot;/path/to/my/mirror/repo&quot;/&gt;

	&lt;target name=&quot;create-mirror&quot;&gt;
		&lt;p2.mirror source=&quot;http://download.eclipse.org/eclipse/updates/3.8&quot; destination=&quot;${target.dir}&quot;&gt;
			&lt;iu id=&quot;org.eclipse.platform.sdk&quot; /&gt;
			&lt;iu id=&quot;org.eclipse.pde.junit.runtime.addon.feature.group&quot; /&gt;
		&lt;/p2.mirror&gt;
	&lt;/target&gt;
&lt;/project&gt;</pre><p></p>
<p>When your Ant task is ready to execute in a <code>build.xml</code> file, you can use a batch file or shell script to execute. A shell script would look something like this.</p>
<p></p><pre class="crayon-plain-tag">/path/to/my/eclipse -noSplash -application org.eclipse.ant.core.antRunner -buildfile /path/to/my/build.xml</pre><p> </p>
<h2>Mirroring tips</h2>
<p>My first suggestion is to mirror only what you need to. You don&#8217;t need to mirror an entire Eclipse repository just in case you need something. Think hard about what your dependencies are and mirror those. Also, if you create a target definition that works with an Eclipse repository, you can view that file in an XML editor to find out what ids to use in the mirror task.</p>
<p>I also prefer to mirror different frameworks to separate local p2 repositories. So if you need EMF, GEF and the Eclipse Platform, I would create three separate mirrored p2 repositories. I find that this makes the mirrors easier to manage. If you&#8217;d prefer to see all of your mirrors as a single internal p2 repository, <a href="http://wiki.eclipse.org/Equinox/p2/Composite_Repositories_(new)">composite p2 repositories</a> make this very easy to do.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F25%2Frcp-best-practices-mirror-eclipse-repositories%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Mirror%20Eclipse%20repositories" id="wpa2a_12">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Set up a target platform</title>
		<link>http://www.modumind.com/2012/10/23/rcp-best-practices-set-up-a-target-platform/</link>
		<comments>http://www.modumind.com/2012/10/23/rcp-best-practices-set-up-a-target-platform/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1674</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<p>When you start work on a new RCP project, one of the first things you should do is set up a <em>target platform</em>. I usually create a target platform <em>before</em> I create any other project.</p>
<h2>What is a target platform?</h2>
<p>In every software project, there are two types of code:</p>
<ul>
<li>First, there is the <em>code you write</em>. This is usually represented by a set of projects in your workspace.</li>
<li>Second, there is the <em>code you are reusing</em>. This might be common libraries such as Log4. It would certainly include the core RCP bundles. It may also include upstream dependencies you have in your own organization (frameworks, utilities, etc.).</li>
</ul>
<p>This second type of code is our target platform.</p>
<h2>How do I set up a target platform?</h2>
<p>Target platforms are created using a <em>target definition file</em>. For Tycho build purposes, target definition files should always be stored in a separate project. So the first step is to create a project called something like <code>com.mycompany.myapp.target</code>. This can be just a simple project, not a Java or Plugin project.</p>
<p>Inside this project, create a target definition file. I&#8217;m not going to go into detail on this (you can get more info <a href="http://help.eclipse.org/juno/topic/org.eclipse.pde.doc.user/guide/tools/editors/target_editor/target_editor.htm">here</a>). I will make a few suggestions, though.</p>
<h2>Target locations should always be p2 repositories</h2>
<p>Target definitions point to sets of features and bundles which will be available to your application. It&#8217;s possible to point target definitions at folders on your filesystem or even Eclipse installations, but this is not a good idea. Ideally, all of your target locations will be <em>Software Site</em> locations, meaning they point to p2 repositories. This is especially important for setting up Tycho builds.</p>
<h2>Carefully select initial target features</h2>
<p>Your target platform will define the set of features and bundles which <em>may</em> be shipped with your application. Whether they will or not depends on your feature and product definitions, as we&#8217;ll see in later posts.</p>
<p> To start with, though, your target should at least contain the RCP SDK feature (for either RCP 3 or 4). This will guarantee you have the base bundles needed to ship an RCP application along with the <em>source bundles</em> you need to debug and browse the RCP source code.</p>
<p>You may also (especially if you&#8217;re working with RCP 3), want to step up to the Eclipse Platform SDK feature. This is useful if you want to add in other platform functionality such as the Forms API or the Common Navigator. Note that the Platform SDK feature will also bring in the RCP SDK feature, so you don&#8217;t have to list them both.</p>
<p>Behond the Platform or RCP SDK features, you can then add whatever else you need. GEF, EMF, whatever you require. To consume your own upstream dependencies, you will want to point at internal p2 repositories holding your own snapshot or release builds. For those of you familiar with Maven builds, this functions in a similar way to internal Maven repositories.</p>
<p>Finally, if you&#8217;re doing unit testing you&#8217;ll want to add the <em>PDE JUnit Runner Support &#8211; Add-on</em> feature. This will provide the bundles needed to create and run unit tests on your code. For some reason, this feature is not included in the main releases repositories. </p><pre class="crayon-plain-tag">http://download.eclipse.org/releases/juno</pre><p> You need to go to an updates repository, such as </p><pre class="crayon-plain-tag">http://download.eclipse.org/eclipse/updates/4.2</pre><p> Here are some sample targets you can use to get started. Right-click on the link to download the target you want.</p>
<ul>
<li><a href="/downloads/eclipse38-rcp-sdk.target">Eclipse 3.8 &#8211; RCP SDK</a></li>
<li><a href="/downloads/eclipse38-platform-sdk.target">Eclipse 3.8 &#8211; Platform SDK</a></li>
<li><a href="/downloads/eclipse42-rcp-sdk.target">Eclipse 4.2 &#8211; RCP SDK (pure RCP 4)</a></li>
<li><a href="/downloads/eclipse42-compatibility-rcp-sdk.target">Eclipse 4.2 &#8211; RCP SDK + compatibility layer</a></li>
<li><a href="/downloads/eclipse42-compatibility-platform-sdk.target">Eclipse 4.2 &#8211; Platform SDK + compatibility layer</a></li>
</ul>
<h2>Final thoughts</h2>
<p>Properly managing your target platform is one of the keys to successfully using RCP. There are many other points to make related to target platforms, and I&#8217;ll be coming back to this topic repeatedly in future posts. But for now my point is that using a correctly defined target platforms is one of the most important best practices I can think of.<br />
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F23%2Frcp-best-practices-set-up-a-target-platform%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Set%20up%20a%20target%20platform" id="wpa2a_14">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/23/rcp-best-practices-set-up-a-target-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Use the correct tools</title>
		<link>http://www.modumind.com/2012/10/18/rcp-best-practices-use-the-correct-tools/</link>
		<comments>http://www.modumind.com/2012/10/18/rcp-best-practices-use-the-correct-tools/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1669</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<p>It might seem that selecting tools for RCP development is pretty straightforward, but there are a number of choices to make and common mistakes to avoid. Here are my suggestions for setting up your tooling for RCP work.</p>
<h2>Use the correct packaging of Eclipse</h2>
<p>One of the most common mistakes I see is developers selecting the wrong packaging of Eclipse. This is especially true when developers initially set up Eclipse to work with non-RCP technologies such as J2EE. If you are installing Eclipse to do RCP work, you&#8217;ll want to select one of the following packagings:</p>
<ul>
<li>Eclipse Classic</li>
<li>Eclipse for RCP and RAP developers</li>
</ul>
<p>These packagings will give you the tools you need (e.g. the Plugin Development Environment). They will also come with the <em>source bundles</em> you need to browse and debug the framework code and extend framework extension points. If you ever see warning messages in the manifest related to extension schemas not being found, you&#8217;re probably missing the source bundles.</p>
<p>Of course you can install the PDE tooling into any Eclipse packaging and that&#8217;s fine as well. And as we&#8217;ll see in future posts, the source bundles will eventually be supplied by your <em>target platform</em>.</p>
<p>Note that if you&#8217;re targeting pure RCP 4, you&#8217;ll need to <a href="http://www.vogella.com/articles/Eclipse4RCP/article.html#tutorial_installation2">install extra tooling</a> yourself, no matter which Eclipse packaging you select.</p>
<h2>Use the latest version of Eclipse</h2>
<p>There is no real technical reason to use an older version of Eclipse, though there may of course be organizational issues to deal with. Oftentimes developers will use an older version of Eclipse because that&#8217;s the version of RCP being targeted. This type of coupling between our tools and our target is something we can avoid using a target platform.</p>
<h2>Use Window Builder for GUI development</h2>
<p>Many of us continue to develop GUIs by hand, but you should really consider using <a href="http://www.eclipse.org/windowbuilder/">WindowBuilder</a> instead. It&#8217;s very easy to install WindowBuilder into Eclipse, so give it a try.</p>
<h2>Use Maven Tycho for builds</h2>
<p>In my opinion, <a href="http://www.eclipse.org/tycho/">Maven Tycho</a> is by far the best build tool for RCP development. I&#8217;ve set up many builds using both PDE Build and Tycho and there&#8217;s really no comparison. Tycho is easier to set up, runs unit tests (this is horribly difficult with PDE Build) and provides you access to the Maven ecosystem of plugins.</p>
<h2>Use Git for version control</h2>
<p>If you have a choice of VCS, choose <a href="http://git-scm.com">Git</a> over SVN or CVS. This is particularly true when working within the Eclipse ecosystem, as most projects are moving to Git. Also the <a href="http://www.eclipse.org/egit/">Git tooling for Eclipse</a> is very good and is under active development.</p>
<h2>Use Hudson for continuous integration</h2>
<p>In the CI server area, the most common choices are <a href="http://www.eclipse.org/hudson/">Hudson</a> and its recent fork, <a href="http://jenkins-ci.org">Jenkins</a>. I don&#8217;t want to wade into the Hudson vs. Jenkins debate here, but I tend to go with Hudson because it&#8217;s managed by the Eclipse Foundation. My feeling is that Hudson will evolve in ways that are particularly useful to developer using Eclipse technologies.</p>
<h2>Final Thoughts</h2>
<p>There are many other tools and plugins that can be used for RCP development, but these are the major pieces to put in place. I&#8217;d like to use the comments section of this post to collect other useful tools, so please share your recommendations.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F18%2Frcp-best-practices-use-the-correct-tools%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20tools" id="wpa2a_16">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/18/rcp-best-practices-use-the-correct-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Use the correct version of RCP</title>
		<link>http://www.modumind.com/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/</link>
		<comments>http://www.modumind.com/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/#comments</comments>
		<pubDate>Tue, 16 Oct 2012 14:30:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1544</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<h2>RCP 3 or 4?</h2>
<p>One of the hottest topics of discussion in the Eclipse world right now is when to migrate to RCP 4. A recent post by Wim Jongman argues that <a href="http://industrial-tsi-wim.blogspot.com/2012/10/why-eclipse-e4-egg-laying-woolmilkpig.html">now is the time</a>. I generally agree with this, and so my first suggestion here is to use RCP 4 if you can.</p>
<p>So what might stop you from using RCP 4?</p>
<h2>Legacy dependencies</h2>
<p>The biggest technical issue right now is that there are many Eclipse features which still rely on the legacy framework. So if you have a dependency on any of these features, you cannot develop against a &#8220;pure&#8221; RCP 4 platform.
<p>Some of these features will be replaced or migrated to RCP 4 over time. Some may never make the switch. If you&#8217;re considering a move to RCP 4 you should take a serious look at all your dependencies and decide whether they can be removed or re-implemented in some way. In some cases this isn&#8217;t too difficult, but not always. Here&#8217;s a partial list of &#8220;legacy&#8221; features that I&#8217;ll try to keep updated. Please use the comments to offer corrections or additions.</p>
<p><em>Note: I hope that no one takes this list as any type of criticism. A ton of great work has gone into RCP 4 and there&#8217;s a lot of legacy code to migrate. If there&#8217;s something on this list you really need, consider migrating it and submitting a patch.</em></p>
<ul>
<li>Help system (including context sensitive help)</li>
<li>Common Navigator Framework</li>
<li>Resource Explorer</li>
<li>Common views (Console, Log, Error, Properties, Progress)</li>
<li>Status line contributions</li>
<li>Progress display</li>
<li>Preferences dialog</li>
<li>Wizard integration (File &gt; New, File &gt; Import, File &gt; Export)</li>
<li>Perspective shortcuts</li>
<li>Perspective switcher</li>
<li>Activities API (often used for security)</li>
<li>Update Manager</li>
<li>About window</li>
<li>Splash handlers</li>
<li>Standard Eclipse commands and default handlers</li>
<li>Editor framework (one to many editors with menu integration)</li>
<li>RAP (single-sourcing)
<li>GEF</li>
<li>GMF</li>
<li>Graphiti</li>
<li>EMF Editors</li>
</ul>
<p><h2>Migration and mixed-mode development</h2>
<p>The solution to legacy dependencies is an environment where RCP 3 and 4 code can happily co-exist. This so called <em>mixed-mode</em> platform would not only allow us to consume legacy dependencies but also make it possible to gradually migrate our existing code to the new framework.</p>
<p>There are <a href="http://eclipsesource.com/blogs/2012/06/18/migrating-from-eclipse-3-x-to-eclipse-4-e4/">a variety of options</a> for mixing RCP 3 and RCP 4 code. Unfortunately, non of these support a true mixed-mode platform. The closest we can get to a mixed-mode solution right now is to use the <a href="http://tomsondev.bestsolution.at/2011/06/10/how-to-apply-the-e4-programming-model-to-3-x/">e4 bridge</a>, and I&#8217;d like to hear feedback from anyone using this.</p>
<p>For those interested, one roadblock to a true mixed-mode platform is the <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=376486">inability to add RCP 4 elements to the application model when running on the compatibility layer</a>. Hopefully this will get resolved in Eclipse 4.3.</p>
<h2>Compatibility layer</h2>
<p>If you cannot make the jump to RCP 4, it&#8217;s still possible to take advantage of many RCP 4 features by running on the compatibility layer. While you won&#8217;t be able to add RCP 4 parts to the application model, you can still access contexts, style with CSS and much more. There are still <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=362420">some quirks</a> with the compatibility layer (most of my clients are still running on RCP 3.8), but it&#8217;s very easy to try it out and see if it works for you.</p>
<h2>Final Thoughts</h2>
<p>There are two scenarios right now where a pure RCP 4 solution makes sense:</p>
<ul>
<li>A brand new project with no legacy dependencies</li>
<li>A legacy project that can be completely migrated in one release cycle</li>
</ul>
<p>If you&#8217;re not in one of these situations, my suggestion would be to continue with RCP 3 (or RCP 4 with the compatibility layer). There may be some applications that may never fully migrate to RCP 4 (the Eclipse IDE is itself a good example of this). Personally, I&#8217;m going to continue to offer RCP 3 training and I think this option will make sense for many, especially those with large investments in the the platform.</p>
<p>Finally, I&#8217;d really like to get your feedback here. Have you migrated to RCP 4? If so, what challenges or issues did you face? Eventually I&#8217;d like to have a whole section here devoted to RCP 4 migration and your input would help a lot</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F16%2Frcp-best-practices-use-the-correct-version-of-rcp%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Use%20the%20correct%20version%20of%20RCP" id="wpa2a_18">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCP Best Practices &#8211; Use RCP for the right reasons</title>
		<link>http://www.modumind.com/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/</link>
		<comments>http://www.modumind.com/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/#comments</comments>
		<pubDate>Thu, 11 Oct 2012 14:45:00 +0000</pubDate>
		<dc:creator>Patrick</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Rich Client Platform]]></category>

		<guid isPermaLink="false">http://www.modumind.com/?p=1539</guid>
		<description><![CDATA[Getting started Introduction Know where to get help Use RCP for the right reasons Use the correct version of RCP Use the correct tools Set up a target platform Mirror Eclipse repositories Create a product configuration Define products with feature based dependencies Remove versions from product dependencies Always run code using a product configuration Get [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Getting started</strong></p>
<ol>
<li><a href="/2012/10/08/eclipse-rcp-best-practices/">Introduction</a></li>
<li><a href="/2012/10/09/rcp-best-practices-know-where-to-get-help/">Know where to get help</a></li>
<li><a href="/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/">Use RCP for the right reasons</a></li>
<li><a href="/2012/10/16/rcp-best-practices-use-the-correct-version-of-rcp/">Use the correct version of RCP</a></li>
<li><a href="/2012/10/18/rcp-best-practices-use-the-correct-tools/">Use the correct tools</a></li>
<li><a href="/2012/10/23/rcp-best-practices-set-up-a-target-platform/">Set up a target platform</a></li>
<li><a href="/2012/10/25/rcp-best-practices-mirror-eclipse-repositories/">Mirror Eclipse repositories</a></li>
<li><a href="/2012/10/30/rcp-best-practices-create-a-product-configuration/">Create a product configuration</a></li>
<li><a href="/2012/11/01/rcp/">Define products with feature based dependencies</a></li>
<li><a href="/2012/11/06/rcp-best-practices-remove-versions-from-product-dependencies/">Remove versions from product dependencies</a></li>
<li><a href="/2012/11/08/rcp-best-practices-always-run-code-using-a-product-configuration/">Always run code using a product configuration</a></li>
<li><a href="/2012/11/12/rcp-best-practices-get-your-product-building-right-away/">Get your product building right away</a></li>
</ol>
<p>The Eclipse Rich Client Platform is extremely powerful but it&#8217;s not for everyone. If you&#8217;re going to use it, you should understand exactly why it&#8217;s the right choice for you.</p>
<p>People are often initially drawn to Eclipse RCP because it supplies so much out of the box. You&#8217;ve got a workbench, perspectives, editors, views, wizards and much more to work with.</p>
<p>This is not a bad reason by any means, but you need to make sure that your application fits into the structure provided by the Eclipse platform. I&#8217;ve seen many teams struggle with trying to fit their application into a form that works with the RCP UI model. Having said that, RCP 4 offers much more UI flexibility and we&#8217;ll get to in a future post.</p>
<h2>Modularity</h2>
<p>In the end, the best reason to use Eclipse RCP is that it is not just a UI framework, it&#8217;s a <em>modular</em> UI framework. This is both incredibly important and pretty unique. And RCP&#8217;s close integration with OSGi makes it one of the only UI technologies to leverage modularity from the ground up.
<p>The best uses of Eclipse RCP that I&#8217;ve seen leverage this modularity to achieve things that would be difficult if not impossible using any other platform. Here are some of the most common ways that I see teams taking advantage of the power of RCP.</p>
<p><em>Note: The following content comes from a longer post I did earlier called <a href="what-is-rcp">What is RCP (and why should I care?)</a> You can check out that post for a more in-depth discussion of this topic.</em></p>
<h3>Use case 1: Customizations</h3>
<p>A common scenario is that you would like to deploy an application to various customers, but some of them would like customizations. Let&#8217;s take an example. What if a particular customer wants an additional option to show up in a context menu? </p>
<p><img src="/wp-content/uploads/2011/04/why-rcp-customization1.png" alt="" title="why-rcp-customization" width="500" height="133" class="aligncenter size-full wp-image-1291" /></p>
<p>Think about how you would do that with the technology you&#8217;re currently using. My guess is that you would have to create a separate branch for that customer and recompile the entire application. With RCP, you would simply create a bundle that contributes the additional menu item and the associated functionality. Ship that bundle to your customer and you&#8217;re done.</p>
<p><img src="/wp-content/uploads/2011/04/why-rcp-customization2.png" alt="" title="why-rcp-customization2" width="550" height="177" class="aligncenter size-full wp-image-1293" /></p>
<h3>Use case 2: License management</h3>
<p>What if you deploy your software as a set of independently licensed units? Or maybe you provide different levels of service based on licensing? </p>
<p>RCP makes this easy because it allows you to break up your functionality into independently deployable bundles. If a customer wants to upgrade or add a licensed unit, simply ship the additional bundles and they&#8217;ll become part of the application. </p>
<p><img src="/wp-content/uploads/2011/04/why-rcp-license1.png" alt="" title="why-rcp-license" width="550" height="177" class="aligncenter size-full wp-image-1304" /></p>
<p>This is much different than simply shipping a new JAR to your customer. With RCP, the additional bundles will cause new menu items, editors, wizards, etc. to automatically and seamlessly show up in the base application. </p>
<h3>Use case 3: Sharing a common workbench</h3>
<p>In corporate environments, it&#8217;s often desirable to have a common workbench into which a variety of functional units can be deployed. The common workbench contains core functionality related to security, database access and other common services. The most notable example of this approach is the JPMorgan Chase <a href="http://www.eclipse.org/community/casestudies/jp_morgan_final.pdf">OneBench</a> effort.</p>
<p><img src="/wp-content/uploads/2011/04/why-rcp-workbench.png" alt="" title="why-rcp-workbench" width="550" height="177" class="aligncenter size-full wp-image-1307" /></p>
<p>Various units, or applications if you like, can be deployed into the workbench based on an end-users role in the organization or other criteria. The individual applications can be developed faster and with a more uniform look and feel because they are leveraging the common services provided by the workbench.</p>
<h3>Use case 4: Deploying to both desktops and the web</h3>
<p>An extreme form of modularity provided by RCP is the ability to completely swap out the presentation technology layer. The <a href="http://www.eclipse.org/rap/">Rich Ajax Platform</a> supplies a set of bundles that can be swapped into your application and the result is that the same code can run both on desktops and on the web.</p>
<p><img src="/wp-content/uploads/2011/04/why-rcp-web.png" alt="" title="why-rcp-web" width="550" height="360" class="aligncenter size-full wp-image-1310" /></p>
<p>Of course things are not as simple as that. There are issues such as singletons and session management to consider. But on the whole, it&#8217;s possible to reuse the majority of your code in both the desktop and web environments. And again, it&#8217;s the modularity associated with RCP that makes this possible. </p>
<h2>Final Thoughts</h2>
<p>There&#8217;s nothing really like Eclipse RCP, it basically allows you to create applications that are extensible in the same way that the Eclipse IDE is. If I had a penny for every time I&#8217;ve seen a project that created it&#8217;s own extensibility mechanism (usually based on some mangled usage of Class.forName()), well I&#8217;d probably have about 25 cents by now.</p>
<p>So if extensibility and modularity are important to you, Eclipse RCP is definitely the way to go. Make the most of it. And finally, have you been taking advantage of Eclipse RCP in ways I haven&#8217;t described here? I&#8217;d love to hear what uses you&#8217;re putting RCP to.</p>
<p><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="DZone" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Digg" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_evernote" href="http://www.addtoany.com/add_to/evernote?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Evernote" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/evernote.png" width="16" height="16" alt="Evernote"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_friendfeed" href="http://www.addtoany.com/add_to/friendfeed?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="FriendFeed" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/friendfeed.png" width="16" height="16" alt="FriendFeed"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_squidoo" href="http://www.addtoany.com/add_to/squidoo?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Squidoo" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/squidoo.png" width="16" height="16" alt="Squidoo"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;linkname=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.modumind.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.modumind.com%2F2012%2F10%2F11%2Frcp-best-practices-use-rcp-for-the-right-reasons%2F&amp;title=RCP%20Best%20Practices%20%E2%80%93%20Use%20RCP%20for%20the%20right%20reasons" id="wpa2a_20">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.modumind.com/2012/10/11/rcp-best-practices-use-rcp-for-the-right-reasons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
