I'm just starting learning Swing, and I was wondering if anyone actually uses java.util.Observer and java.util.Observable when writing MVC applications in Swing. It seems much cleaner to me for all relevent methods in both the Views and the Models to deal with application specific Model and View interfaces instead of the general Observer/Observable methods.
I made my own event publisher before I stumbled across Observer / Observable. It supports custom listener interfaces, arbitrary method parameters and return types and unsychronized life cycles. It takes a bit more typing (copy paste ) but does everything I need. [ January 04, 2006: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Use them if you wish, but note that there is nothing special about them: they are not used in the API and if you look at their source code there is not much to them! There is also no common practice of using them widely in Swing app code, from what I'e seen. In short, no big wup. [ January 05, 2006: Message edited by: Jeff Albrechtsen ]
There is no emoticon for what I am feeling!
Joined: Dec 13, 2004
All right, thank you for the replies everyone!
subject: Does anyone use java.util.Observer/Observable in Swing?