Re: MVC/MVP swing GUI
- From: Tomislav <hefestLOVELYSPAM!@xxxxxxxxx>
- Date: Fri, 03 Feb 2006 23:27:46 +0100
Thomas Weidenfeller wrote:
I would be surprised if you find a "clean" one (of course depending on your criteria for "clean"), for a couple of reasons (in no particular order, this is an endless subject):
I should have said "give me some best practice advice or something like that".
- Scaling/scope, more particular, matching the real world to the pattern is also an issue with Swing (or applications based on similar toolkits). E.g. take a simple form-type entry dialog with a couple of text fields for data entry. How should the Model(s) look like? What are they? Where are they? Each text field has an own Model, or should the sum of the text entries (some kind of data set) be the Model? But what if that set of data from that particular dialog window is just an excerpt from some larger data set? Wouldn't it be good to treat that large data set as the Model? But if you do that, what do you provide as input/output to the dialog? All this is solvable and is solved in practice, but it dilutes a "clean" application of MVC.
- Expanding further on the above dialog example, when you implement something like this, you will soon figure out that you need some kind of transactions. Not something which is defined in MVC or MVP. E.g. you don't want that each single keystroke changing data in a text field is immediately applied to the Model. You want that all changes at once (and typically either all changes or non, probably with a chance to undo them, too) are applied to the Model. So where do you hold the intermediate changes? From the GUI widget's point of view, there should be some Model holding this data, but that Model is not the "real" Model which is finally changed from an application's point of view. Again, all this can and is solved in practice, but you won't find anything of this in "clean" MVC or MVP.
This is a great, very understandable description of the problem, thanks. I hate to add a sentence or two to a whole block of text, but this is just so well written with obvious crystal clear understanding of the issues involved. Wow. :)
Back to the problem at hand: is there a best (or just "very good") practice on building swing MDI GUIs? Again, an example would be great.
My problem's a bit complicated because it has to do with swing, but also with Netbeans Matisse (which is an important decision factor to try to implement a java rich client) and finally with application design theory and recommendations. This is not a nice place to be without a *lot* of specific experience, I can tell you. :)
No hints as to what I can look at? I've tried JRubik as I think it sports a state-of-the-art interface, but it's internal plugin architecture drove me off...I'm looking for something simpler, more relevant to my problem (a database oriented GUI), easier to understand etc.
TIA,
Tomislav
.
- Follow-Ups:
- Re: MVC/MVP swing GUI
- From: David Segall
- Re: MVC/MVP swing GUI
- References:
- MVC/MVP swing GUI
- From: Tomislav
- Re: MVC/MVP swing GUI
- From: Thomas Weidenfeller
- MVC/MVP swing GUI
- Prev by Date: Re: How to capture the click event of a window
- Next by Date: Re: JEditorPane and HTML links
- Previous by thread: Re: MVC/MVP swing GUI
- Next by thread: Re: MVC/MVP swing GUI
- Index(es):
Relevant Pages
|