[Glass] Large collection and common practice

Mariano Martinez Peck via Glass glass at lists.gemtalksystems.com
Tue Jan 3 11:39:01 PST 2017


On Tue, Jan 3, 2017 at 3:14 PM, BrunoBB via Glass <
glass at lists.gemtalksystems.com> wrote:

> Hi All,
>
> I have a lot RcKeyValueDictionary where the key is the id of the object and
> the value is the object itself.
> This id once assigned it does NOT change, so far so good :)
>
> The RcKeyValueDictionary is used intensively to add and remove objects (in
> my case OrbeonFormInstance). The dictionary is very useful because the key
> is always given as parameter.
>
> Also there are searchs by specific inst var of OrbeonFormInstance class
> (like username,group, createdTime and so on).
>
> My problem is that i can NOT create an index on aRcKeyValueDictionary.
> So which is the commom practice in these cases:
> 1- Change the RcKeyValueDictionary to be an UnorderedCollection ?
> 2- Add a new instance variable to the class that holds the
> RcKeyValueDictionary and this new variable to be anUnorderedCollection ?
>
> 1) This will complicate my direct searchs using the ID.
> 2) Extra computation when adding and removing objects (now there 2
> collections to maintain)
>
> The general question will be something like:
> When Dictionaries are very suitable to store large quantity of objects but
> indexes are also needed which solution should be implemented ?
>


Assuming you do need or get benefits from the RC flavor (else it brings
unnecessary overhead), then quickly analyzing the situation (until GemStone
have indexed and rc-flavor Dictionary impl), I think I would use a
RcIdentityBag. I would create a identity index for #id , and yes, you will
have to modify your code that access the dict, to know detect on the
collection using the identity index of ID.

But...I am sure someone more experienced will come with a better approach!

Cheers,



> regards
> bruno
>
>
>
> --
> View this message in context: http://forum.world.st/Large-
> collection-and-common-practice-tp4928607.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20170103/638d49b1/attachment-0001.html>


More information about the Glass mailing list