 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
antoine Guest
|
Posted: Wed Aug 30, 2006 7:10 am Post subject: looking for complex code example for best swing / MVC practi |
|
|
Hello,
I've been using Swing to develop complex GUI (standalone applications)
for quite some time and feel confident with the language, the
components, the layout, all the graphic part basically, however I get
the feeling I still can't grasp the good way of dealing with MVC /
separating business logic from graphic elements.
I've been searching for a complete & complex example application with
good design, from which I could learn & realize my mistakes, but
couldn't find any through google so far...
would anyone know of such app ? maybe an open source project ?
thanks for any info you might contribute...
-Antoine |
|
| Back to top |
|
 |
Karsten Lentzsch Guest
|
Posted: Wed Aug 30, 2006 7:10 am Post subject: Re: looking for complex code example for best swing / MVC pr |
|
|
antoine wrote:
| Quote: | [...]
I've been searching for a complete & complex example application with
good design, from which I could learn & realize my mistakes, but
couldn't find any through google so far... [...]
|
Martin Fowler describes desktop patterns that I found useful
for working with Swing, especially "Presentation Model" and
the Model-View-Presenter (MVP) variants, and a bunch of other
less important patterns such as Presentation Chooser or
Event Aggregator.
Martin motivates these patterns and why one would separate
the presentation logic from the presentation in a longer text.
Just google for "Organizing Presentation Logic".
I provide presentations that describe the architecture
of the JGoodies tools and demos. These slides complement
Fowlers texts and pattern descriptions; my focus is on
the concrete Swing implementation.
My favorite pattern for Swing is "Presentation Model",
because Swing already includes a good portion of the
synchronization necessary for using this pattern.
The free JGoodies Binding tutorial contains source
code examples for using "Presentation Model" with Swing.
And so you can get the following for free: Fowlers motivation,
and his pattern catalog, my slides with additional diagrams,
smaller Swing source code examples. My presentations are here:
http://www.jgoodies.com/articles/
-Karsten |
|
| Back to top |
|
 |
unomystEz Guest
|
Posted: Sat Sep 02, 2006 7:41 pm Post subject: Re: looking for complex code example for best swing / MVC pr |
|
|
Karsten,
I looked at your presentations and they are very good, thanks. What
about when dealing with extremely high performance GUI applications
that have a lot of complexity at the model layer, enough to warrant
writing a custom event dispatch/firing mechanism - as opposed to using
the built-in Java dispatching. ie, consider a stock application that
monitors 2000 stocks and stock prices can change very often, in total
maybe 40 updates a second a realized, then up to 30 swing components
per stock needs to be notified which could result in a lot of firing
and handling per second. What are your thoughts on this?
Karsten Lentzsch wrote:
| Quote: | antoine wrote:
[...]
I've been searching for a complete & complex example application with
good design, from which I could learn & realize my mistakes, but
couldn't find any through google so far... [...]
Martin Fowler describes desktop patterns that I found useful
for working with Swing, especially "Presentation Model" and
the Model-View-Presenter (MVP) variants, and a bunch of other
less important patterns such as Presentation Chooser or
Event Aggregator.
Martin motivates these patterns and why one would separate
the presentation logic from the presentation in a longer text.
Just google for "Organizing Presentation Logic".
I provide presentations that describe the architecture
of the JGoodies tools and demos. These slides complement
Fowlers texts and pattern descriptions; my focus is on
the concrete Swing implementation.
My favorite pattern for Swing is "Presentation Model",
because Swing already includes a good portion of the
synchronization necessary for using this pattern.
The free JGoodies Binding tutorial contains source
code examples for using "Presentation Model" with Swing.
And so you can get the following for free: Fowlers motivation,
and his pattern catalog, my slides with additional diagrams,
smaller Swing source code examples. My presentations are here:
http://www.jgoodies.com/articles/
-Karsten |
|
|
| Back to top |
|
 |
Karsten Lentzsch Guest
|
Posted: Sun Sep 03, 2006 4:14 pm Post subject: Re: looking for complex code example for best swing / MVC pr |
|
|
unomystEz wrote:
| Quote: | [...] What
about when dealing with extremely high performance GUI applications
that have a lot of complexity at the model layer, [...] in total
maybe 40 updates a second a realized, then up to 30 swing components
per stock needs to be notified which could result in a lot of firing
and handling per second. What are your thoughts on this?
|
Repainting costs more than firing and listening to events.
If performance is critical, identify the hot spots that
consume the time, and I guess it'll be drawing and potentially
revalidation of the views. Check the standard tricks to
improving the painting performance: invalidate only necessary
portions, honor the clipping rectangle, consider using
a customized repaint manager.
Two years ago I worked with apps that fired and observed
10 times more events than are handled by my recent code.
(Before 1.0 the JGoodies Binding lacked the BeanAdapter)
Reducing the number of events and handlers did result
in no perceived performance improvements. The motivation
for reducing the number of events and handlers was debugging.
If you have more concerns about performance, you may
post at the forums at javadesktop.org. It seems to me
that the audience is larger there, and that you get
feedback from AWT/Swing team members there.
-Karsten |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|