David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler

    Web app developer since 1994 and Google Cloud Platform Instructor now residing in Colorado. Besides tech, I enjoy landscape photography and share my work at ColoradoPhoto.gallery.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 224 other followers

  • Sleepless Nights…

    October 2009
    S M T W T F S
  • Blog Stats

    • 1,034,589 hits

Archive for October 6th, 2009

GWT PropertyChangeListeners come full circle with MVP

Posted by David Chandler on October 6, 2009

I initially stumbled on the excellent Model-View-Presenter pattern for GWT while wading through discussion threads on the various library options for PropertyChangeSupport (since GWT does not offer it natively). In the process, I’ve found that I’m unable to completely avoid the need to store a few things in a client-side model, and the model turns out to be the most convenient place to fire an event indicating that the model has been updated, which looks an awful lot like…a PropertyChangeEvent/Listener.

	void setPrayerLists(List<PrayerList> prayerLists)
		this.prayerLists = prayerLists;
		// Hah, we're back to PropertyChangeListeners, after all
		eventBus.fireEvent(new PrayerListsModifiedEvent(prayerLists));

Of course, the event now being fired is now my own, not a PropertyChangeEvent, so I no longer need a PropertyChangeSupport emulation library and no longer have to worry about the accompanying idiosyncracies involving collections, etc. And thanks to GWT’s HandlerManager and related classes, I can fire events for any purpose, not just PropertyChangeEvents, and the event can carry a payload such as accompanying data in its constructor. I just mean to say that firing events off model changes still turns out to be useful in some cases. And I somehow find that humorous.

Posted in Google Web Toolkit, Model-View-Presenter | Leave a Comment »

Securing JSF Applications Against the OWASP Top Ten

Posted by David Chandler on October 6, 2009

My JSF security presentation in now available in PDF format from the Writings page above.

Posted in JavaServer Faces, Web App Security | 5 Comments »

%d bloggers like this: