Although I have tried to use MVC for Web applications (where to be frank I implemented a greatly simplified version of Struts without realising it) I have never been quite sure as to the benefit of doing so in a Swing application nor exactly how if I am honest.
Now though I have much more incentive to learn how to do it properly. The introduction of the excellent GUI builder Matisse in NetBeans means that it is incredibly easy to knock up a Swing GUI quickly. However to really get the maximum benefit I can see that it is important to separate the actual implementation of the underlying logic of the application from the generated code. This was exactly the problem that used to occur with Forte, JBuilder and Cafe. You would have a big wodge of generated GUI code and then an unrelated and unmanaged block of application code that often had to reside in the generated GUI code to make.
In addition I have also comes across an incredibly obtuse MVC implementation at work. This reminds me of my own attempts to implement MVC for web applications. You kind of know the principle but you’re not sure what that translates to in terms of the concrete classes and code you have to produce. I don’t personally believe in spending a lot of time bringing existing code up to scratch where you know the underpinnings are not strong. It is easier and probably better to look at what the code is meant to do and then implement that correctly rather than end up painting yourself into a corner by trying to reconcile the purpose of the code with its current implementation.
To help my understanding of MVC in a Swing application I therefore want to have a very simple reference application I can use to build up my understanding of how such an application should work and be implemented. I’ve chosen to do a very simple ToDo list application based on the Google ToDo list plugin for their Desktop app. This would be handy for me personally as I need such an application and also removes a lot of the issues with designing the application by providing a reference for the behaviour.
Next step then a few uses-cases/activity diagrams and a class diagram for the model.