tips Tag

JFace Data Binding allows you to attach only one validator to a binding. Putting all constraints into one validator is essentially bad design and compromises reusability. Here's a trick for dealing with this limitation of the data binding API and at the same time, keeping your validators small and reusable. When binding a source observable to a target observable in JFace Data Binding, it is possible...

Read More

This post describes an easy – but little known way – to use native libraries (.dlls) with Eclipse RCP. In my current work, I'm shipping an RCP application that interacts directly with hardware connected to the user's machine. These interactions are done through drivers, written in C, that are available in binary form as shared libraries. The use of shared libraries introduces a few problems: In order to load...

Read More

Apache CouchDB offers high availability, excellent throughput and scalability. These goals were achieved using immutable data structures - but they have a price: disk space. CouchDB was designed under the assumption that disk space is cheap. Though it is indeed getting cheaper and cheaper, it is not infinite. Here's a tip to reduce CouchDB database files' disk consumption. When a CouchDB document is updated, the new...

Read More

The release of the RAP protocol is an important milestone. The protocol enables native mobile client Apps (in addition to the existing browser client) to connect to the RAP server. In other words, the data is now sent over the network by using JSON instead of proprietary JavaScript. One thing we noticed, was that the server responses were not compressed anymore by the server. On company...

Read More

Recently, I was asked how to create a web application that allows the user to draw on images: We have an application to deliver training content to medical professionals. An important issue for us is user-interaction with images. E.g. displaying images and allowing users to draw on them. The example below shows how to draw on a static image using our Eclipse RAP framework. It works as follows: Create...

Read More

JUnit and Eclipse are a great combination, but one thing that I missed every time I worked with JUnit4 was the code templates. Currently, Eclipse ships with pre-defined templates for JUnit3 but not for JUnit4. So, I wrote three basic JUnit4 templates that can be imported from the "Templates" Preference Page. Take a look at the screenshot below to see how to get there. The...

Read More

This Effective Mockito Post will be IDE specific again but related to the last post on Mockito's spies. If you've read Part 3 you should now be familiar how to use them to "pseudo mock" statics. When writing code it often comes to a point where we want to debug using single step debugging. When using Mockito and especially when spies come into the game...

Read More