You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2015/10/14 11:18:55 UTC

Re: svn commit: r1708560 - in /ofbiz/trunk: framework/base/lib/guava-14.0.1.jar specialpurpose/solr/lib/runtime/guava-14.0.1.jar

BTW it's good to have guava lib in base/lib as explained recently by the (still?) only paid member of the Groovy project (Jochen Theodorou) because of 
its persistent collections

<<persistent collection are collections (may or may not implement the Collection interface) which cannot be modified later on. they have nothing to do 
with persisting data in a database or on hard disc. They are just more functional structures. Even though you cannot modify them, you can combine the 
structure with new elements and get a new structure. So a list+element will create a new list consisting of the old list and the new element. But they 
will not just copy over data, they will reuse the internal structure of the old list. A very simple form is that of a filo stack. It can be a simple 
linked list of elements and we add the new element in front, letting us to reuse the old list to almost 100% and to create only a very small amount of 
new objects. There are of course lists, sets and maps.

So why use them? Unlike unmodifiable made collections in Java, these persistent collections are relatively safe to share between threads with minimal 
synchronizations. Also, if you are working with functional idioms they are more fitting the implicit assumptions of the data not being modifiable.

Java collections are in general a bad fit here, since Collections are more or less assumed to be modifiable. pcollections for example tries to bridge 
that. In a Java8 world there is of course streams, which are a much better fit in that. >>

Also maybe time to move to Java 8 as Taher reminded us recently. I think I'll have a look at that again soon...

Jacques


Le 14/10/2015 10:51, jleroux@apache.org a écrit :
> Author: jleroux
> Date: Wed Oct 14 08:51:36 2015
> New Revision: 1708560
>
> URL: http://svn.apache.org/viewvc?rev=1708560&view=rev
> Log:
> Move guava lib from solr/lib/runtime to base/lib to avoid dependency on solr component, thanks to Vyom for the reminder
>
> Added:
>      ofbiz/trunk/framework/base/lib/guava-14.0.1.jar
>        - copied unchanged from r1708559, ofbiz/trunk/specialpurpose/solr/lib/runtime/guava-14.0.1.jar
> Removed:
>      ofbiz/trunk/specialpurpose/solr/lib/runtime/guava-14.0.1.jar
>
>