Surveying new territory
{Thursday, June 30th, 2005}My current project has certainly proven to be a refreshing change. After countless projects in large organizations, culminating in experiencing enough red tape to seemingly circumvent the globe, working on project as part of a small team more capable of responding to feedback has been a breath of fresh air.
Swingin’.
*Thankfully* I’m finally working on an application whose primary interface is a rich Swing UI. Virtually all my web development experiences have attempted to mimic rich desktop interfaces in some way. The resounding belief among technicians on these projects was that the wrong UI was being employed for the task. It seemed ease of deployment and the trend towards web applications were the foundation for UI selection. Before the AJAXers of the world arc up, yes AJAX widens the scope of applications suitable for a web interface, but desktop applications will always have their place - I can’t see an advanced word processor being replaced by a web application anytime soon.
So it’s been a flashback to the heady days of Applet development via AWT, my original experiences in the Java landscape. During the experience I’ve been surveying the OS community for frameworks assisting with Swing development. Surprisingly, Swing hasn’t been impacted by a ‘Struts’ framework like web development has. It seems most OS efforts continue to be in handy UI components such as file choosers and tree views, the same sorts of components that were being sprouted for Delphi and C++ Builder many years ago.
It seems a handful of potentially useful Swing specific tools have sprouted though - Foxtrot and Spin address management of Swings event dispatching thread. Some tools compose UI’s via XML, lessening the burden of composing complex component layouts. Others offer trivial infrastructure to somewhat simplify event management. Still, none seem to offer significant value above sound OO concepts. It seems you could roll your own infrastructure to do similar jobs in a relatively short amount of time.
PicoContained.
One of the first principles I’ve instilled on my new assignment is the elimination of Lookups and Singletons in favour of Dependency Injection. To that end we initially employed PicoContainer, using NanoContainer to support an XML configuration. After the initial grief of discovering NanoContainer’s poorly documented schema, I soon encountered some nasty bugs in PicoContainer’s heirarchcal container features. So I chose to replace PicoContainer with a purpose built container, taking all of 1 day to complete. I appreciate that PicoContainer is a project that now accommodates many languages and means of configuration, but from my experience an ultimately limited set of it’s functionality is put to use. So much so that rolling your own implementation to accommodate your circumstances turns out to be a reasonable proposition.
Java Deprecated Objects (JDO).
Unfortunately, the team has inherited JDO as our persistence technology. Surely the best reason an organization could have to use JDO above other ORM tools (i.e. Hibernate) is that they made a significant investment in an initial implementation. In any other circumstance, given the controversy of overlapping JDO and EJB specifications that lead to delays in the acceptance of the JDO 2.0 specification, wiser heads would seek alternative persistence solutions. To a large degree I already consider the JDO specification deprecated, waiting to be superseded. Sure, if you’re already using it, maybe it’s easier to move with it. But if you have no legacy considerations, why choose a technology that’s already dated, especially given better solutions to the problem of persistence are available?
I have a couple of gripes about JDO’s API:
- The API is bloated. The key class (PersistenceManager) contains 55 methods. Granted, a fair amount of that is convenient function overloading, but the result is a cumbersome API.
- I really dislike the concept of ‘live’ objects. I much prefer explicitly saving an object. The JDO team seem to have acknowledged that some prefer this approach by introducing detach and attach features.
Granted these gripes are relatively minor and plenty of people have used JDO successfully for their persistence needs.
Big Mac.
So I’ve now had 2 weeks using a dual CPU Mac with Tiger for 9 to 5 use (ahhhh….it’s a tough life). The experience was pretty cool, but I encountered my fair share of problems. Above the usual keyboard layout complaints, here’s a few others:
- IntelliJ’s key bindings needed some serious surgery. Above the changes made by the IntelliJ team to accommodate not being able to use the first few function keys in Mac apps, there were a couple of key bindings out-of-the-box that plain old didn’t work. Some examples: F9 to resume a debugging session, and what the heck happened to Alt+D to ‘Do Refactor’? In all I’ve probably changed about 50ish key bindings to date.
- Why not support the Windows convention of using Ctrl for editor actions, like Ctrl+C for copy? I appreciate that traditional Mac users are acustomed to using the Mac key so it needs to be supported, but for cross-platform apps (i.e. IntelliJ) to not support both a generic and Mac specific keymap is madness. Admittedly, I’m being fanatical on this point as I’m a Java developer who changes operating system frequently.
- Running a headless JVM ends up presenting *** Attention *** Please attach debugger. Press any key to continue….. Nasty.
Still, 2 weeks and I’m just about hooked. The ‘eye candy’ factor is significant as well, it seems when I look at a Windows installation now, my first impression is that it’s, well….pixcelated.
