Posted by forax
on January 8, 2007 at 2:20 PM PST
This short blog entry is an answer to the question:
why don't provide property change support natively in the Java compiler.
Among the questions about my
property proposal and its implementation .
One can be answered easily.
Why don't provide property change support ?
Because there are several ways to implement a property change support
depending on what you want.
I've try to categorize them, conbinations are possible:
- Listener and event
can be at least the following couple:
or the swing lightweight ChangeListener/ChangeEvent.
- Register/unregister listeners
Listeners are stored in a collection, but which one ?
A list or a set. Is the collection threadsafe,
using synchronized blocks, locks or other concurrent mecanisms ?
The traversal is in ascending, descending or any order.
- Listener and thread
The listener method is called by the current thread,
another thread (using by example an executor) or
a special thread (like the EventDispatchThread).
I hope you are convinced.