[Seaside] Re: How to store and sort large list in GOODS

Yanni Chiu yanni at rogers.com
Wed Nov 17 05:43:34 CET 2004


Yar Hwee Boon wrote:
> 
> I'm having large lists of data, such as test history and contacts which
> I'm displaying in a paginated table using a WABatchedList subclass. If the
> table is to be sorted (by several different columns), all the elements
> have to be retrieved and compared each time the page is displayed. I'm
> quite new to object databases such as GOODS, is there a better way than
> using an OrderedCollection and sorting it everytime?

If you really must sort on several different columns then
I'd suggest you provide a filter step where the user can
narrow down the list with search criteria. Once the list
size is within a threshold size, then enable the column
sort links.

If you really need a large list sorted by multiple columns,
and you don't want to sort it each time, then you need to
keep a sorted collection for each column -- kind of like
putting an index on a column in a relational DB. When you
add an item to your list, you'd have to add it to all the
sorted collections too. If your lists are too large for
SortedCollection, then you need some other index structure
that allows you to enumerate your list in the desired order.

HTH.
--yanni



More information about the Seaside mailing list