Janek's weblog where all posts go to Eleven
All views and documentation expressed here are mine and not necessarily those of my employer.
David has an interesting article on event-driven GUI programming. He describes two patterns, but usually it comes down this:
The user issues a long-running command and the GUI sends it to the command queue. Other threads receive the command from the queue, compute the result and update the GUI through calls to SwingUtilities.invokeLater().
So far so good. For me, the surprising part is his choice for a message bus. David uses Somnifugi, a single-JVM JMS implementation. The obvious choice for me has always been the standard extension API InfoBus. Despite it's relative obscureness, it's the best tool for event-driven programming inside a JVM that I know.
Of course, with InfoBus producers produce data items and consumers process them. But there are APIs that make InfoBus special:
All in all, it is a complete API for loosly-coupled component interaction in a one JVM. I believe stock JMS does not address all of it. But then, I might have missed something when skimming over the specification.