The Artima Developer Community
Sponsored Link

mediator

Advertisement

Advertisement

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.

Message:

mediator

Posted by Sudha on 18 Aug 1998, 12:42 PM

yes,I first used observer and observable for event notification and realised that my program is unreadable and I changed to generating my own event types.But then I realised my listener interface bloated and finally I used a mediator class which encapsulated all event related information and which has methods to change the event data and it has a methods to register list of listeners for each eventtype whom it notifies when an event data changes.It would be nice if you can elaborate the mediator with observer (observer can have a hash table to store the source listener coupling as suggested in gang of four) and many different ways of doing the notification.
Another interesting problem:
If I have a source which has different handler methods(it has methods like index1Changed,index2Changed for different instances of the same event ( for ex index1,index2)
but event is indexChangedEvent),how do I do it using a generic
adapter class? I know I can use the reflection mechanism but
is there any other way of doing it?

I think we can also use reflection mechanism to notify



Replies:
  • Mediator Dan Greenberg October 22, 2000 at 4:30 AM (0)

Sponsored Links



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