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.


Making an object a listener of one Event and a generator of another?

Posted by Joen Moreno on November 23, 2000 at 4:37 AM

What will be the implication, from a design and performance point of view, if you make an Object a listener to one Event and a generator of another type of event? For example, what if you make the Telephone object in your example implement the ActionListener interface and make the actionPerformed() method call the fireTelephoneRang() method like this

public class Telephone implements ActionListener {

///some codes here

public void actionPerformed(ActionEvent e) {

///some other codes here



Sponsored Links

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