|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
EventList DesignI know it's way too late in the ballgame to even think about redesigning
something as foundational as EventList, but I can't help but wonder if ListModel isn't Sun's intended interface to observe fine-grained changes to a list. If that is the case, perhaps EventList could have been defined as: public interface EventList<E> extends List<E>, ListModel { public ReadWriteLock getReadWriteLock(); public ListEventPublisher getPublisher(); }; I can see some advantages to using interfaces that Sun has already predefined to interface more easily with Swing. One advantage I note is that the ListDataListener interface works in terms of intervals so operations could be batched. For example, an operation like addAll would result in a single call to intervalAdded instead of a separate event for every object added. What got me thinking about this is that JGoodies binding defines an ObservableList that is both a List and a ListModel. What seems to be lacking are the clever pipeline and locking concepts that GL has. Perhaps there is a way to combine the ideas? Bruce --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: EventList DesignBruce,
ListModel falls down in one key area (as do all other implementations of Observable collections). It doesn't describe *arbitrary* change to the List. It assumes all of the change types for a single event are uniform. i.e. in a single ListEvent, all you do is add elements, or remove elements, or update elements. This limits what you are able to do with it in a lot of interesting cases. e.g. - amalgamate multiple ListEvents into a single uber-ListEvent (ThreadProxyEventList) - allow something external to demark the true start and stop to List change (the new NestableEventsList) - reliable network code with GL that need not consider partial failure It's a lot harder to describe *arbitrary changes* to a List, but in end, we think the benefits are worth it. James On 10/24/07, Bruce Alspaugh <compulinkltd@...> wrote: I know it's way too late in the ballgame to even think about redesigning |
| Free embeddable forum powered by Nabble | Forum Help |