The Artima Developer Community
Sponsored Link

Legacy Design Forum
Event Generator Idiom



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.



Posted by Mark Salamon on March 30, 2001 at 10:17 AM

I was studying this article and event generator/observer patterns in greater detail and I was trying to determine the real need for the EventObject. It seems to me that all the EventObject does is wrap a reference to the event generator and then pass that reference to every listener when an event occurs. The downside is that an EventObject needs to be created each time (although I guess a reference to one could exist all along in the event generator). Why not just get rid of the eventobject and instead have the generator pass a reference to itself directly to the listeners?


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us