I proposed this talk as I think there is not a lot of information available for people setting out to build large swing applications. So I wanted to share what I have learned from working on several and building one from scratch. Hope to see you there 🙂
Why Spaghetti Is Not Tasty: Architecting Full-Scale Swing Apps
This presentation tackles the biggest issue in building medium- to large-scale Swing applications: if they are not architected from the beginning, there is a high possibility of the interconnections and communication (events/listeners) becoming the biggest pile of spaghetti you have ever seen. This leads to unmanageable application code; slipping project deadlines; spiraling development costs, and in bad cases, project failure. The presentation sets out to explain the main issues a developer is likely to come across in trying to build a full-scale Swing application.
• Wiring – how does one part of the application gets access to another part—for example, how does the Open action in the File menu get access to the main panel to change its content or how does a dialog box access the main frame?
• Communication – when something changes in the application’s state, how do you notify all the interested parts of the application? For example, if you change the selection of items in the main view of your application, how many parts of the application will need to know about that selection change. For starters, there are bound to be a load of actions for Select All, Copy, and Paste that might want to be enabled/disabled, based on the selection. You may have detail panels that show the details of the selected item that need to change their content and so on.
• Modularity – How do you break a large application down into manageable parts that can also make it easy to manage and split within a team.
The session also explains the common ways of handling these issues and discusses the pros and cons of each, including introducing open-source solutions such as Eclipse OSGi, NetBeans software, and Platonos. It finishes up with a fully realized example architecture for large Swing applications that the speaker developed for Imagery (www.xerto.com/imagery) and some hands-on demonstrations of how to get started and code a simple application with this framework. Attendees receive a URL for downloading the framework so they can try it themselves.
The presentation aims to guide the attendees through gaining a understanding of the issues to having a good idea of how to solve them at a code level, so they don’t end up with a pile of spaghetti.
What do you think about using a framework (such as NetBeans RCP for example) to build this kind of medium- to large-scale Swing applications?
It seems it’s kind of difficult to use this kind of framework but once the knowledge is acquired, I guess it goes a lot faster… what do you think about this?
I think using one of the available RCPs is a very good way to go. The is a good amount of effort is required to get a thorough understanding of one of these platforms but once you have it can save you a lot compared to rolling your own. At the time when I was working on Imagery there were no good Swing RCPs around so I was forced to roll my own. There are still some problems I came across developing Imagery that are not well addressed in Eclipse RCP and probably Netbeans RCP as they were both designed as the basis of IDEs and other applications throw different requirements on a framework. If I was starting out now I would take a detailed look at Netbeans RCP, Spring RCP and Spring OSGi project.
Thanks for your answer. I’d be really interested in seeing your speech !
If you have any doc/video you can put on the web or send by e-mail… do not hesitate 😉
Thanks for your blog.
Hi Jasper,
I’m currently evaluating a number of frameworks like this for use in a couple of open source projects, so your talk would be really interesting for me. Unfortunately I’m working in Bulgaria at the moment so won’t be able to make it to JavaOne.
Will there be any way for people not attending to get a look at the presentation and framework source?
Cheers,
Ian.
Code will go on one of the opensource sites like dev.java.net and I will put links and the talk up on here.
Thanks!
Hi Jasper,
As one of the authors of Platonos, I wish you all the best in your talk. I sadly can not make it to JavaOne this year. Please do let us know if there is anything we can do to help your talk with regards to our framework, and Swing Desktop development in general. I would love to offer another interesting take on dynamic pluggable action sets that I have come across in a previous job that was really quite brilliant.