Hi everyone. I recently started developing an application using Java and SWT. I'm happy with the progress, but the GUI related code is getting to messy. It just seems that there is a lot of state information to pass around, even for the simplest operations.
For example, something as simple as opening a window carries with it a lot of state information, because depending on the way the window was opened, different widgets should be initialized in different ways. I find myself using temp variables to hold initialization values, which easily can be misused, if I forget to set or reset them. This is just one example, there are other issues I come across regularly.
So, I'd like to ask the GUI gurus around for some books or web articles that help in designing good architectures for GUI applications. Preferrably, please list practical books/articles with real code. I deal better with examples than purely theoretical concepts (I prefer to study these after having some practical grasp of the subject).
The chapter will be Swing based but will have examples of a number of patterns. In the process of writing this chapter I've done considerable research looking for GUI application architecture resources and didn't find that many resources. In terms of pure patterns Martin Fowler has some information on his wiki about Model View Presenter and Presentation Model.
First of all, my apologies for taking so long to reply. I'm also a musician and music teacher so I don't get to work on programming every day and sometimes it's not possible for me to check stuff out regularly.
Thanks a lot for your help. I found the Martin Fowler article especially useful because it has working code which to me makes things much clearer. I'll probably check the Wiley book when it comes out.
As for your book, although I'm using SWT, I got very curious about it, since it seems to cover a lot of very useful subjects. The thing is, I hate reading on the computer, so I'd like to know if it's possible to get a printed version? If so, what's the policy regarding updates, since from what I gathered the book is not yet complete?
Sure, you can get a printed copy at Amazon.com or LuLu.com. The chapter on patterns, MVC, Presentation Model, etc will be released at the beginning of July. It should be available in the print version a few days after that. Even if you use SWT a significant portion of the book should still be useful. There are ports of FormLayout and JGoodies Data Binding for SWT for instance.