Did you know? DZone has great portals for Python, Cloud, NoSQL, and HTML5!

Wayne Beaton is employed by The Eclipse Foundation where he works as an evangelist, spreading the word and helping folks adopt Eclipse technologies. Wayne has extensive experience in object-oriented software development and is a strong proponent of refactoring, unit testing, and agile development methodologies. He is also the editor-in-chief of Eclipse Corner, PMC Lead for the Technology Project, Project Lead for the Examples Project, and an advisor for osbootcamp. In 1982, he received the prestigious Chief Scouts Award from then-Governor General Edward Schreyer. In 1984 his team was selected to represent beautiful British Columbia in the Kinsmen Voyageur Relay. In his spare time, he writes down meaningless accomplishments from his youth in a lame attempt to impress the reader. Wayne is a DZone MVB and is not an employee of DZone and has posted 56 posts at DZone. View Full User Profile

Getting to Know EBERT

12.17.2008
Email
Views: 3329
  • submit to reddit

The Eclipse Examples Project has a 0.1 release review scheduled for next Tuesday (December 23). For this review, there are two components: The Eclipse Business Expense Reporting Tool (EBERT) and Image Utilities. I’ll defer discussion of Image Utilities for another day…

As the name suggests, EBERT is an application that can be used to capture business expenses. For the time being, it’s not all that usable an application (it doesn’t do all that much yet). But that’s not the point: EBERT is intended to serve as an example of how you might go about building an application using various Eclipse technologies. Perhaps the coolest thing about EBERT is that it is intended to run as a desktop application using Eclipse Rich Client Platform (RCP), a server application using Rich Ajax Platform (RAP), and an embedded application using embedded Rich Client Platform (eRCP). What makes this cool is that this level of portability is not a build trick, it’s a packaging trick.

EBERT on RAP

EBERT has a set of common bundles that are used across all three platforms. These bundles contain the bulk of the application code including the domain models, and the three views that make up the user interface. Additional bundles provide platform-dependent behavior. On eRCP, for example, we have access to a set of “command” buttons that surround the display; where the views are tiled in the RAP and RCP version, they’re stacked in eRCP due to limited space. In its current form, the RCP version offers a slightly richer user interface than the other two (via bundles that augment the “common” behavior). However, recent developments in RAP are going a long way toward leveling this distinction (the next version of the application will leverage these developments).

There were many interesting challenges in the development of this example. Perhaps the most challenging challenge was living with the restricted Java Runtime Environment available on the embedded platforms. I opted to restrict the “common” bundles to the Connected Device Configuration (CDC) 1.1, Foundation Profile 1.1 (CDC-1.1/Foundation-1.1) which, conveniently, is supported by a wonderful eRCP-ready Nokia phone that I happen to have handy.

CDC/Foundation is effectively a Java Runtime Environment for devices with “moderately constrained” resources that provides a restricted set of Java APIs; it is basically Java SE 1.3 excluding the APIs for user interfaces (fortunately RCP/RAP/eRCP provides this for us). I opted to restrict the “common” projects to Java 1.3 syntax (though I believe that 1.4 syntax is supported).

While the restriction was a big challenge, it was never a show-stopper. It was frustrating at first to learn that JavaBeans are not supported by core CDC-1.1/Foundation-1.1, and I had to leverage some Eclipse platform code to provide something similar to bound properties. Of course, that little issue cascaded modestly into further issues when I started using the JFace DataBinding APIs. I’ve got a bug open to explore whether or not we can use EMF in this environment. I think the answer is “yes”, but I haven’t (embarrassingly) had the time to investigate yet.

Over the coming days and weeks, I’m going highlight some of the more interesting parts of EBERT…

From http://dev.eclipse.org/blogs/wayne

Published at DZone with permission of Wayne Beaton, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)