« Return to Thread: Tracking changes in EventLists

Re: Tracking changes in EventLists

by James Lemieux :: Rate this Message:

Reply to Author | View in Thread

This could be easily accomplished if your data objects modeled whether they are:

isModified(), isCreated() or isDeleted().

Creating 3 FilterLists immediately derived from your BasicEventList would then answer your questions for you.

Alternatively, you simply want to write your own ListEventListener (with a cache of the source EventList so you can look up deleted items after the fact). That's a pretty small amount of code... less than 20 lines for sure. You'd install that ListEventListener on your BasicEventList and then query it later for the changes, as you outlined in your code. Are you having troubles writing this ListEventListener (which you call tracker)? Are you uncomfortable with caching the values of the source list for the benefit of retrieving DELETED items?

James

On Sun, Jul 26, 2009 at 11:53 PM, Witold Szczerba <pljosh.mail@...> wrote:
2009/7/27 James Lemieux <jplemieux@...>:
> [...] A couple other considerations for you in
> this space:
>
> 1) TransactionList can buffer things for you, if that somehow helps.
>
> 2) UndoRedoManager can also track changes and undo/redo them, if that's
> somehow useful to you.

All I actually need is to query for changes, like in my example:
tracker.getDeletedFrom(someList)
tracker.getAddedTo(someList);

This is because the application is just a front-end to system deployed
on application server. When user, for example, gets list of cars, then
add two cars and removes three of them and presses "save" I am sending
to server information:
get rid of cars id=[23,45,98] and then add two new cars [car1=....,
car2=....] which is eventually translated into
'delete from Cars where id=....'
'insert into cars (....) values (...)'

So I really do not need to buffer changes; when I want to get rid of
them, I can just download data from server again and reset the
tracker.

Other thing is: I need it only for simple lists, not for the
transformations. I think that it all would get so trivial if such a
"tracker" could be installed only on the lists which are actually a
source of data, not some kind of transformations... but that could
break the EventList interface transparency. On the other hand, if
BasicEventList would have extra methods for trackers... :)

Regards,
Witold Szczerba

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


 « Return to Thread: Tracking changes in EventLists