commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <>
Subject Re: [lang] Notifier
Date Tue, 12 Nov 2002 22:37:08 GMT

On Tue, 12 Nov 2002, Stephen Colebourne wrote:

> Some comments/suggestions:
> - Does JDK1.4 not have something similar? Does that matter?

Does it? Damn. Hadn't been aware of it. There is Observer/Observable, but
that's pretty useless.

> - There should not be a no args constructor

*grin* Go ruining my loosely typed alternative mode :) The one person who
wants a FooListener and a BarListener, both with methods named
foobar(Event) is going to curse you.

> - The constructor/methods should validate for null passed in and throw IAE

No prob.

> - The setListenerMethod should be changed to be a second constructor
> Notifier(Class, String)

No prob. I have a bean-habit of trying to always have empty constructors
and do all code using set methods.

> - The getListeners method could return an unmodifiable list of listeners.
> Alternatively, it should pass the listeners collection into the constructor
> of ArrayList, its more efficient like that.

Happy with both these.

> - The notify(Method, EventObject) method seems to expose the detail that you
> are trying to hide

Nearly did make this private. Am happy to make it so.

> - The methods could/should be cached in a HashMap for the notify(String,
> EventObject) case


> - Synchronization is needed

Yep. Planning for the unit-test to be a threaded attack on it. Wanted
feedback before I went to that level of effort.

> - Should it have its own package - events ?

I dunno. Do we expect a lot like this? Possibly I guess.

> Well just some initial thoughts. Its a new area for [lang], but the event
> classes are in java lang/util. If we are releasing in the next couple of
> weeks it would need a little thought.

I'm happy for it to skip to the next version, I think it's cool, and
DbUtils has some code using it, but DbUtils isn't going to have a release
for a while.

I've commited some of your changes, just so no one repeats them.
Synching/caching still to go.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message