Re: managing helma collections
Joshua Paine <joshua <at> papercrown.org>
2007-08-07 02:54:58 GMT
Maksim Lin for technical support mailling lists wrote:
> can this be implemented in the current persistance subsystem?
I am approximately nobody to Helma, but I've mapped out (in my head) a
fairly memory-efficient way to do [most of] getOrderedView on
arbitrarily large SQL-mapped collections (i.e., have the DB do the
ordering but still use Helma's object cache and retrieve the rows as
their proper type, etc., as though they had been retrieved directly from
their Hop parent). This could be done just in JavaScript with the
interfaces we have now, though some minor fiddling with the Java DB
stuff instead of helma's DB class would make it more efficient.
getOrderedView returns a collection which has these properties (in the
logical sense):
1) contains the same set of objects as the _children of the collection
(typically a HopObject) that called it--no more nor less
2) its children may be in a different order from that in which they are
mapped in the creator object
3) has [almost] all the usual methods of HopObject
4) but you can't extend it, b/c it's actually a Bean (or something) and
created in Java code, not JavaScript code
5) stays in sync with its creator collection in that it sees deletes and
adds in real time
It would be pretty easy to get 1, 2 and 3, improve on 4, and lose 5. 4
is nice in principle, but not all that important for what appears to be
the most common use case (get a subset of a sorted list of the children
so we can easily display them).
First step is (in a new method, because the current method has its place
(Continue reading)