RCP Best Practices – Use the correct tools

Getting started

  1. Introduction
  2. Know where to get help
  3. Use RCP for the right reasons
  4. Use the correct version of RCP
  5. Use the correct tools
  6. Set up a target platform
  7. Mirror Eclipse repositories
  8. Create a product configuration
  9. Define products with feature based dependencies
  10. Remove versions from product dependencies
  11. Always run code using a product configuration
  12. Get your product building right away

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.

Use the correct packaging of Eclipse

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’ll want to select one of the following packagings:

  • Eclipse Classic
  • Eclipse for RCP and RAP developers

These packagings will give you the tools you need (e.g. the Plugin Development Environment). They will also come with the source bundles 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’re probably missing the source bundles.

Of course you can install the PDE tooling into any Eclipse packaging and that’s fine as well. And as we’ll see in future posts, the source bundles will eventually be supplied by your target platform.

Note that if you’re targeting pure RCP 4, you’ll need to install extra tooling yourself, no matter which Eclipse packaging you select.

Use the latest version of Eclipse

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’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.

Use Window Builder for GUI development

Many of us continue to develop GUIs by hand, but you should really consider using WindowBuilder instead. It’s very easy to install WindowBuilder into Eclipse, so give it a try.

Use Maven Tycho for builds

In my opinion, Maven Tycho is by far the best build tool for RCP development. I’ve set up many builds using both PDE Build and Tycho and there’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.

Use Git for version control

If you have a choice of VCS, choose Git over SVN or CVS. This is particularly true when working within the Eclipse ecosystem, as most projects are moving to Git. Also the Git tooling for Eclipse is very good and is under active development.

Use Hudson for continuous integration

In the CI server area, the most common choices are Hudson and its recent fork, Jenkins. I don’t want to wade into the Hudson vs. Jenkins debate here, but I tend to go with Hudson because it’s managed by the Eclipse Foundation. My feeling is that Hudson will evolve in ways that are particularly useful to developer using Eclipse technologies.

Final Thoughts

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’d like to use the comments section of this post to collect other useful tools, so please share your recommendations.