Rich Client Platform

Interesting opportunity for RCP/OSGi experts

February 18th, 2010  |  Published in Announcement, OSGi, Rich Client Platform, eclipse

One of the things I love about being a trainer is that I get to visit and work with so many development teams. Every group of developers has their own chemistry, culture, skills and domain interests. Sometimes I think I’m learning as much as the teams I’m training.

As it happens, one of the teams I’ve enjoyed working with the most is looking for a full-time RCP/OSGi project lead. The company, EXTOL, is a small, successful ISV that creates B2B integration tools. I don’t do this too often, but I wanted to pass this on because I think it’s such a cool opportunity. What’s so cool about it, you ask?

  • First, I don’t think there’s any better programming job than working for a small ISV. You can have a big impact and what you do matters. A lot.
  • EXTOL is re-architecting it’s products from the ground up (this is greenfield development) and they’re using a lot of interesting technologies – RCP, OSGi, EMF, GMF and more.
  • One of the coolest things they’re doing is leveraging OSGi on both the client-side and server-side. Very few projects are leveraging OSGi in this way, and I think the opportunities here are awesome.
  • Finally, the team is great. The developers are smart and easy to work with, management knows how to let developers be successful.

So what’s the catch? Well, whether there’s a catch or not depends on what you’re looking for in your life at the moment. EXTOL is located in a small town (Pottsville) in the hills of eastern Pennsylvania. It’s a beautiful area with lots to do outdoors, a great place to raise a family and much more. It’s not for everyone, but I imagine it would be great for more than a few of the developers I’ve met.

If you’re interested, here’s a post on the EXTOL blog that goes into more detail. They’ll also have developers at EclipseCon, so feel free to introduce yourself to one of them (or me) if you’re there as well.

Decoupling Eclipse RCP products from feature versions

October 6th, 2009  |  Published in Rich Client Platform, Tips, eclipse

I just spent some time updating the sample projects I provide to help Eclipse RCP developers get started with PDE Build. One of the main reasons for the update was to decouple the product configurations from specific feature versions, and I thought it was worth a post to talk about this.

What’s the problem?

By default, product configurations are hard-wired to specific feature versions. And if you decide to upgrade to a new version of the org.eclipse.rcp feature, for example, then your product configuration will break. You won’t be able to create valid run configurations based on your product and your builds will fail as well.

Luckily, we now get feedback in the Product Configuration Editor informing us that something is amiss.
products-and-features-1
So what can we do about this? Well one approach is to re-wire your product to the new version of the feature. You can do this by deleting and re-adding the feature, or you can also click the Properties button and modify the feature version manually. But this is a brittle approach, as you need to remember to update your configuration every time a feature version changes.

A better way

It’s now possible to decouple products from feature versions by replacing the feature version numbers with 0.0.0. In the future, a blank feature version will also be interpreted as 0.0.0 but as of Eclipse 3.5.1 the number must be added.

Also, there is a currently a defect in the Product Configuration Editor that results in a feature version entry of 0.0.0 being ignored. Of course, this won’t matter once blank versions are interpreted correctly, but for now it’s a problem. The solution is to open the product configuration file in a text or XML editor and change it manually.
products-and-features-2
The good news is that you only need to do this once. Your product will now accept the feature versions you supply in your target platform without complaint. Of course if you want to maintain the wiring between products and feature versions, by all means do that. But it’s nice to know we can decouple these pieces if we wish.

Common Navigator Framework Tip #1 – Know when to use it

October 2nd, 2009  |  Published in Rich Client Platform, Tips, eclipse

Of all the posts I’ve written on this blog, those on the Common Navigator Framework have been among the most popular. This is a little surprising to me, as I don’t hear CNF mentioned very frequently. My guess is that this framework is quietly becoming an essential part of Eclipse RCP.

Because of this, I’ve decided to write a set of posts discussing some of the CNF tips that I’ve found valuable over the years. And I think the best place to start is knowing when to use it. The Common Navigator Framework is complicated because it is trying to solve a complicated problem. It will only make your life easier if you’re using it for the purpose it’s designed for. So what is that purpose?

Modularity and extensibility

Well first, CNF was not created to make the development of navigators easier. If you have fairly normal navigator requirements in your application, CNF is probably not for you and you’ll save yourself a lot of headaches by omitting it.

Instead, CNF is designed to create navigators that support modularity and extensibility. With CNF, various OSGi bundles in your RCP application can contribute navigator content at runtime.
cnf-tips-1
CNF allows your bundles to declaratively contribute content to a navigator, and this is not a simple exercise. As users of CNF, we need to wire together navigators and their content in sophisticated parent/child relationships, and then overlay on top of this structure a set of actions, filters, drag/drop handlers, etc.

Does it have to be so hard?

Some of you might be thinking modularity is supposed to help us to simplify our applications. Why does this stuff have to be so darned hard? Well this is true to a point. Modularity allows us to take information hiding to an entirely new level and to the extent that we can hide complexity, our applications become simpler.

But when dealing with modular UIs in particular, the difficultly arises when we work with the joints or pivot-points between modules. In these specific cases, there is always complexity because we have to define in detail how our modules relate to each other.

So the next time you’re struggling with a complex CNF extension point, ask yourself whether you really need this functionality. If you do, then embrace CNF for what it is: a complex solution to a complex problem.

A simple update manager for Eclipse RCP applications

September 29th, 2009  |  Published in Ramblings, Rich Client Platform, eclipse

sparkle-ui

What would I like for Christmas? Thanks for asking! Well, besides a Mac mini, what I’d really like is a simple update manager for Eclipse RCP applications.

Up to now, we’ve had two options for updating our applications: wiring in the Update Manager or coding something from scratch. The problem is that the Update Manager is overkill for most RCP apps and the API is fairly complicated.

What I would like to have is an alternative to the Update Manager that provides very basic update functionality. Call it Update Manager Lite, if you like. For those of you running OS X, what I’m thinking of is something like the Sparkle framework that many Mac applications use.

Would this be of use to anyone else? I’ve opened a Bugzilla entry suggesting this and comments would be appreciated.

Update: There’s already a Bugzilla entry for this feature, so the above entry has been marked as a dup. Please direct any comments you have to the original Bugzilla entry. Thanks to Susan McCourt for pointing me in the right direction!

Why Eclipse RCP? One company provides it’s answer.

September 9th, 2009  |  Published in Rich Client Platform, eclipse

People often ask me what’s so special about Eclipse RCP and what types of projects it’s useful for. Well here is one answer from EXTOL, a software company that is using Eclipse RCP as the foundation for it’s own products.

The short answer, which I like a lot, is:

Adopting Eclipse RCP gets us out of the framework business.

But please read the entire post for all the details. It’s well worth your time.

Renaming Eclipse RCP – Final results

September 9th, 2009  |  Published in Announcement, Rich Client Platform, eclipse

iStock_000008699441XSmallWell the results of the survey are in, and the clear favorite is the existing name: Eclipse RCP. While the original purpose of the survey was to create a short-list of names, I think the strong showing of the existing name means that the process should stop here. So long live Eclipse RCP!

For those of you interested in a summary of the results, 472 people took the survey (which is pretty good, I think). The top 5 name were:

  1. Eclipse RCP – 169 votes
  2. Eclipse Platform – 51 votes
  3. Aurora – 48 votes
  4. Corona – 38 votes
  5. Tangram – 32 votes

There were also many write-in votes, some of which were kind of amusing:

  1. Colbert (only 2 votes, sorry Stephen!)
  2. AlBlue’s Big Bundle of Fun
  3. Twilight

On a more serious note, I’d like to thank everyone who took the survey and all of those who expressed their opinion both publicly and privately. One of the great things about open-source software is that we are able to make decisions as a community, and I think this process has been a good example of that.

Managing Eclipse RCP launch arguments

September 8th, 2009  |  Published in Configuration, Rich Client Platform, Tips, eclipse

In my last post I discussed how to best manage run configurations for Eclipse RCP applications. But there was one related topic I wanted to discuss in more detail, and that is how to manage launch arguments.

What are launch arguments?

Launch arguments are arguments that are added to the command line when you execute your application. These arguments come in two flavors:

  • Program arguments – Arguments that are Eclipse-specific. For example, the -clean argument will clear the configuration area on startup.
  • VM arguments – Arguments that make sense to the Java VM. For example, the -Xmx argument allows you to set the maximum heap size for the VM.

Both of these argument types can be set on the Arguments tab in the Run Configurations dialog.
launch-arguments-1

Launch arguments and the target platform

We oftentimes want to apply the same launch arguments to all of our run configurations, and one way to handle that is to specify them on your target platform. On the Target Platform preference page there is a section where you can add whatever arguments you wish.
launch-arguments-2
The arguments associated with a target platform will be added to run configurations generated from the Manifest Editor. They will not be added to configurations generated by the Product Configuration Editor. Also, because the Manifest Editor link does not regenerate a configuration each time, you will need to explicitly delete a configuration if you want to recreate it using new target platform arguments.

Launch arguments and products

A second way to manage arguments is to add them using the Launching tab of the Product Configuration Editor.
launch-arguments-3
When you add arguments in this way, two things will happen:

  1. The arguments will be added to your run configurations if you launch using the link in the Product Configuration Editor. Because this link regenerates the run configuration each time, consistent use of the link guarantees that your configuration is in synch with your product definition.
  2. The arguments will also be added to your deployed application in the form of an INI file. This is a nice feature, but it means that you need to be careful when adding arguments that are only useful during development. For example, you may want to use -clean to clear the configuration area when you’re developing, but you probably do not want to ship this argument to your customers.

Launch arguments best practices

My approach is to add arguments using the Product Configuration Editor and to always launch my applications using the link in that editor. This guarantees that my run configurations are always in synch with my product definition. I also take care to not add arguments that would be detrimental to a deployed application. Some, such as -consoleLog, I consider harmless in a deployed app and I just leave those in.

If for some reason I absolutely have to add an argument that should not be deployed, I usually clean it out of the INI file during the build process. It’s pretty rare for me to have to do this, though.

Renaming Eclipse RCP – only 3 days left to vote!

September 3rd, 2009  |  Published in Announcement, Rich Client Platform, eclipse

imagesThe poll to help select a new name for Eclipse RCP will wrap up on September 6th, so make your voice heard and vote today!

For more information on the purpose of the poll, as well as to see my picks, check out the initial announcement.

Note: You can view the survey results online.

Run Configurations and Eclipse RCP

September 3rd, 2009  |  Published in Configuration, Rich Client Platform, Tips, eclipse

When developing Eclipse RCP applications we execute our code in the IDE using a run configuration. A run configuration is basically a collection of properties that defines how our application should be run, and these properties include:

  1. What application or product to launch, specified by id
  2. Which bundles to make available at runtime
  3. What program (Eclipse-specific) or VM arguments to use

And while run configurations are relatively straightforward, there can be some confusion about how to create and manage them. Hopefully this post will help.

Creating a run configuration

There are three ways to create a run configuration:

  1. By hand (yuck!)
  2. Clicking the Launch an Eclipse application link on the Overview tab of the Manifest Editor.
  3. Clicking the Launch an Eclipse application link on the Overview tab of the Product Configuration Editor.

Let’s ignore creating a run configuration by hand. If you prefer that approach, more power to you! But most of us find it easier to generate run configurations by clicking the editor links mentioned above.

Where some confusion arises is that the two editors in question generate run configurations in different ways. Let’s look at each editor in turn.

Creating a run configuration with the Manifest Editor

It’s possible to generate a run configuration by clicking on the Launch an Eclipse application link in the Testing section of the Manifest Editor. We can also accomplish this by clicking the equivalent toolbar button. Both options are highlighted by the red squares in the image below.
manifest-run-config
But what really happens when you click the link or button? Behind the scenes, the following logic is performed:

  1. The bundle associated with the manifest being edited is searched for an application or product extension. If one is found, that extension will be used when creating the run configuration.
  2. The current run configurations are searched, and if an existing configuration exists for the particular application or product id, then that configuration will simply be reused.
  3. If no matching run configuration is found, then a new one will be created. The available bundle list is created by traversing the dependency graph for the bundle associated with the manifest being edited. The arguments are taken from the current target platform for the workspace.

And what happens if you launch from a bundle that does not contain an application or product? Then the application will be set to Eclipse itself and a new instance of Eclipse will be launched with your bundles added into the mix.

This can be a source of great confusion for Eclipse RCP developers, and this is one reason that I discourage use of the Manifest Editor to create run configurations. On the other hand, it’s usually obvious if you’ve selected the wrong manifest. Your first tip that something is amiss will be the appearance of the Eclipse splash screen. If you’re not seeing your own splash screen, you’ve probably launched from the wrong manifest.

Creating a run configuration with the Product Configuration Editor

Because it’s very easy to create incorrect run configurations using the Manifest Editor, I usually suggest that developers use the Product Configuration Editor instead. The options look very similar in this editor (unfortunately at times they look too similar), and you can see them highlighted in red below.
product-run-config
But while the options look similar in both editors, there are slight differences in behavior. Specifically, the Product Configuration Editor uses the following logic:

  1. First, a new run configuration is always generated. No attempt is made to search existing run configurations for a match, and if one already exists it will be overwritten. This can be particularly important if you’ve made manual changes to your run configurations.
  2. The product id will obviously be taken from the product configuration file, as will the available bundles (Dependencies tab) and arguments (Launching tab). Note that arguments associated with your target platform are not used in this case.

What is the best approach?

As you’ve probably surmised, I suggest using the Product Configuration to create run configurations. Here are the two biggest reasons:

  • It’s easier to make a mistake with the Manifest Editor by selecting a manifest in the wrong bundle.
  • Using the bundle list generated by a product configuration ensures the same bundles will be built into your deployed application. When using the Manifest Editor, it’s very easy to get into a situation where your app works in the IDE, but not after it is built and deployed.

As an aside, it’s possible to generate your run configuration from the Product Configuration Editor and then run it later by clicking the Run button in the main toolbar or selecting it in the Run Configurations dialog. This will obviously not cause your existing configuration to get overwritten.

I choose not to do this because I prefer to treat my product configuration as the only real location for runtime properties. I’ll come back to this issue in a subsequent post, as this discussion has gone a bit long!

Creating an Eclipse RCP target platform

September 1st, 2009  |  Published in Rich Client Platform, Tips, eclipse

The PDE team has given RCP developers some great new features in Eclipse 3.5. It’s now much easier to create and manage target platforms for Eclipse RCP applications. In this post, I’ll outline one simple workflow that should work in most cases.

But first, if you’re interested in what a target platform is or why you might want to create one, check out these previous posts.

So now that you understand why we should create a target platform, what’s the best way to do it?

Create a target definition file

Eclipse target platforms can be created and selected directly in the Target Platform preferences page, but a better approach is to define your target platform using a target definition file. A target definition file outlines what should be included in your target platform and where the features and bundles can be located. More importantly, target definition files can be checked in to your version control repository and shared among the members of your team.

So how do we create one? You see here a sample RCP application that was generated with the Hello World template. Let’s add a target definition to this project.
sample-project

Right-click on the project name and select New > Other. Then choose Plug-in Development > Target Definition in the wizard selection dialog.
new-target-definition
The wizard page prompts you to select a file name, and I’m going to choose samplercp.target to match my project name. Remember, it’s a good idea to have a separate target platform for each project you work on.

Define your target platform

Now that we have a target definition file in our project, we can select what to include in our target platform. We do that by identifying one or more locations that may contain features or bundles. Eclipse 3.5 supports four types of locations (directories, installations, features, and software sites).

In this workflow, I’ll be using a software site which means that the features and bundles will be downloaded from a repository and stored locally under my workspace .metadata folder.

For an RCP application, we typically want to set our target platform to the Eclipse RCP SDK which is made up of two features:

  • org.eclipse.rcp
  • org.eclipse.rcp.source

Let’s add these features to our target platform. Start by clicking Add in the Target Definition Editor (this editor should have opened automatically after you created the target definition file). Then select Software Site on the Add Content dialog and click Next.
target-platform-add-content
The next page of the wizard is where the real work is done. We’re going to specify a repository location where the Eclipse RCP SDK can be retrieved.

  • First, select the Galileo repository from the Work with drop-down.
  • Next, deselect the Group by Category checkbox. For some reason, the Eclipse RCP SDK does not appear anywhere in the category listing. You would think it would be included under the EclipseRT Target Platform Components category, but no such luck.
  • Finally, place a check next to the Eclipse RCP SDK entry in the list and click Finish

target-platform-add-content2
As soon as you click finish, Eclipse PDE will start the process of downloading the RCP SDK to your machine. Your target definition file should look like this:
target-defintion-complete

Activate your new target platform

The final step is to activate your target platform by clicking the Set as Target Platform link in the upper-right corner of the Target Definition Editor. Then you’re all set! And make sure to check in your target definition so everyone on your team can share the fruits of your hard work ;-)