Hi,
I have been searching for a collection where i can create indexes (UnorderedCollection subclasses) but at the same time to be rc (reduces the transaction conflicts) where an object can occur only once and i can not find it. In a RcIdentityBag the same object can appear more than once. I was looking something like RcSet or RcIdentitySet. Regards, Bruno |
Bruno,
I'm afraid that there is no set-based Rc variant, so RcIdentityBag is your guy... Dale On 07/10/2015 02:41 PM, BrunoBB via Glass wrote: > Hi, > > I have been searching for a collection where i can create indexes > (UnorderedCollection subclasses) but at the same time to be rc (reduces the > transaction conflicts) where an object can occur only once and i can not > find it. > > In a RcIdentityBag the same object can appear more than once. I was looking > something like RcSet or RcIdentitySet. > > Regards, > Bruno > > > > -- > View this message in context: http://forum.world.st/Simple-Rc-Collection-question-tp4837044.html > Sent from the GLASS mailing list archive at Nabble.com. > _______________________________________________ > Glass mailing list > [hidden email] > http://lists.gemtalksystems.com/mailman/listinfo/glass _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Hi Bruno, I have often wanted RC variations that are not the ones provided. But you must either implement it yourself or deal with the ones you have. Just FYI, for my data storage, I typically have a dictionary (actually many dictionaries) where keys class names (say Client, Advisor, Account, etc) and the values are a collection holding the instances of such class. So.... I have a dictionary and a collection. And yes, I wanted RC AND index support for the collection. So...As Dale said, I use RcKeyValueDictionary for the dictionary, and RcIdentityBag for the collection class. HTH, On Fri, Jul 10, 2015 at 7:17 PM, Dale Henrichs via Glass <[hidden email]> wrote: Bruno, _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Hi Mariano,
That is my case also, i have Dictionaries where the key is a field name and the value is a Rc collection with all field's form (of some kind of process). ProcessDefinition - has a collection of FormDefinition, each FormDefinition has a collection of FieldDefinition. Each Process Instance has a definition and a collection of FormInstance and each FormInstance has a collection of FieldValue. So... ProcessDefinition has a Dictionary where the key is a field name and the value is a Rc collection with ALL fields values (FieldValue) for that field name (in this type of process). The Rc collection is a RcIdentityBag. But since a form field can be edited and field's values can be added/changed/removed i need a Rc that not allow the same object twice. This is because the field of a form can be "repetable" which means that field named "language" can have multiple values (let say english, spanish, freach). Then before confirming the transition (from one form to another) the form can be edited a now "language" field has the following values (english, italian, spanish2, portuguese). When editing i have 3 scenarios (for a field that is "repetable"): 1- same quanity of fields --> no problem just change values and the index will be recalculated. 2- fields removed --> i have to remove some elements from ProcessDefinition.RcIdentityBag 3- fields added --> i have to add some elements in ProcessDefinition.RcIdentityBag (to be short i omitted some model details) In the beginning i really need a RcSet but now is not neccesary i have created an intermediate class FieldValueHolder (fieldName currentValues toAdd toRemove) that do the job. It basically match the process described above. -currentValues (first values of the field) -toAdd (if newones are added) -toRemove (if an existing one is removed) Regards, Bruno PS: i have to do this because a Rest Service from a Java App send an XML of the form each time is edited. In order to perform a correct search i have to track changes in fields values from the XML. |
Free forum by Nabble | Edit this page |