Hello,
My app contains a root object that contains a set of 12 to 40,000 items (avg 1070). These items contain 3 small sets of 2 to 10 objects a piece. The user can navigate through the various lists, and display the results.
A small set of rules can be applied to this large set of items, via a visitor pattern of sorts. "Does new weight conform to standard zyz", for example.
Some aggregate functions are applied to the set as well, such as "return the combined weight of items with suppler z"
My question is, "What is the best practice for handling large items that seem to negate lazy-loading do to visitation or aggregation".
Pre-hiberate I'd implement a set of smart Iterators that handle lazy-loading, filtering, paging etc, and push the aggregate functions into stored procs. Since I've been using hibernate, everything seems to have become a list.
I assumed if the collections become an issue, I could always use the HQL aggregate functions, but it hasn't come to that. I generally use a singleton persister object that encapsulates the hibernate away from the architecture, so I try to avoid HQL anywhere else.
How do you treat collections which have custom iterators?
Thanks,
[hibernate 2.1.2 jvm 1.4.2/1.5 hsql/ms sqlsvr2k]
|