I'd use an Observer. GUIs that auto-update their values when the underlying model/data they represent changes is one of the classic examples of using the Observer pattern.
JeeBee
2009-07-14 15:20:37
I'd use an Observer. GUIs that auto-update their values when the underlying model/data they represent changes is one of the classic examples of using the Observer pattern.
When I developed our project, we came up with the Observer and EventListener patterns as you did. I believe that those patterns are the same concept as publish/subscribe pattern. We did choose the EventListener(EventObject) way to make loose-coupling between objects and to make more extensibility of functions for events.
The benefit of the EventListener is that we can add more reasonable event functions(?) to the EventListener based on our event requirements. Please, correct me if it goes wrong direction.
I hope it helps.
Tiger.