I plan to migrate my code from Delphi's generic collections to Spring4D's. The approach I used was having a wrapper class that exposed the same methods that TList<> has, and each method call was wrapped with a lock. I'll probably be doing the same thing for Spring's IList<>, so I guess my question is, is that the best approach for thread-safe lists (thread-safe in the context of freely using the lists from anywhere in a read-only fashion, although the list holder can alter the list)?
The second question concerns the additional (helper) methods for specific IList<T> types. The most common scenario would be selecting some objects from the list with the
Where method. What would be the best approach for such methods? Declaring global methods and passing them to the
Where function, adding a wrapper (which would fit the locking scenario mentioned earlier but loses the ability to create collections via TCollections), or something else?
I'm still in the process of getting to know the spring4d code, so don't mind if I'm overseeing something obvious!
Lastly, thanks for working on this awesome library. I've already done some minor tests in comparison to my current lists, and let's just say I've been missing out on both optimizations and versatility your library offers.