« Return to Thread: Incomplete/cached list
I'm working on some task-based software, and want to maintain views of the tasks for easy querying - enter Glazed Lists.
The problem I'm facing:
So, I need to:
- Task lists are relatively transient (e.g. once complete, they are only retained for auditing/reporting purposes)
- The persistence layer is pluggable (might be a database/hibernate, but currently is a different type of store)
- The current implementation is a cache of tasks by id, and run an arbitrarily complex query to determine what id's should be returned (tasks link to other information via universal identifiers, so building a task object may query multiple systems)
1 and 2 I'm thinking will already be supplied, or easily possible, but the last... is this something I'd need to write myself?
- Lazily build the backing list by the view requests
- Update the backing list as appropriate for the requested views
- Automatically dispose list views via same sort of cache-like algorithm
Is this the right thing:
Has this been done before? Is it the right direction to head in?
- Have an CachedEventList that is essentially a cached list (something that will indicate when something is being removed due to cache expiry/size constraints)
- ... referenced by a ListViewCache where lists can be retrieved by matchers:
- If it exists, then return the list view
- otherwise, Request it from the CachedEventList, which will ensure full population
- If the CachedEventList purges a task (expiry/size constraints), the ListViewCache (as a listener of the CachedEventList) will dispose the appropriate views. A brute force implementation could iterate through all the ListViewCache's keyed matchers to see if they match the purged task...
Thanks heaps for an awesome idea/implementation...
Stephen
« Return to Thread: Incomplete/cached list
| Free embeddable forum powered by Nabble | Forum Help |