Jan 02

While the Java community celebrates the release of JavaFX 1.0, two JSRs are striving to teach us again how to write Swing applications - this time, the easy way. JSR 295 addresses property manipulations and bindings, not just in the Swing framework but throughout the Java platform; JSR 296 simplifies Java application creation using Swing, bringing a “Swing for the rest of us” kind of approach.

In this post, I’ll discuss JSR 296 and what it brings, and my opinion of where it could be improved; in the followup post I’ll discuss JSR 295, and try to do the same for that. Continue reading »

Share/Save/Bookmark

Dec 19

Recently I took the time to read the early draft of JSR-292, the invokedynamic bytecode specification. For those slightly less familiar with the subject, it makes it possible to perform late binding on method invocations, allowing for calling methods on objects without knowing the object type at compile time. This feature is important for projects such as Jython and JRuby, which provide Java bytecode compilation to the popular Python and Ruby languages.

Continue reading »

Share/Save/Bookmark

Dec 07

One of the most classic patterns in software is the producer-consumer pattern. There is a module producing data, and a module reading it for further processing. Moreover, in order to achieve better performance, usually there are many consumer modules running on many different threads while the producer (or several producers) run on its own thread. This allows to distribute processing work between threads, and in the multi-core, multi-processor environment of today, between physical processors as well. Concurrent frameworks (such as java.util.concurrent) provide out-of-the-box solutions for these kind of problems.

Same pattern, multiple machines

This pattern also works well when wanting to distribute tasks between different physical machines as well. The producer machine somehow creates information, and offloads the task of processing that information to other machines. Since we want to distribute the work between different machines without coupling issues, the data is written to a physical disk and using some sort of a distribution system (e.g. JMS queues), a notification containing the full path to the data is sent. An available consumer receiving the notification can then read the data from the physical disk and process it. The following diagram illustrates this simple idea:

Continue reading »

Share/Save/Bookmark

Chaotic Java is Digg proof thanks to caching by WP Super Cache!