Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Immutable Datastructures with good Sharing Date: Sun, 6 Nov 2011 14:44:28 -0800 (PST) Organization: http://groups.google.com Lines: 34 Message-ID: <16628826.552.1320619468157.JavaMail.geo-discussion-forums@prlm15> References: Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1320619468 26599 127.0.0.1 (6 Nov 2011 22:44:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 6 Nov 2011 22:44:28 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9690 Giovanni Azua wrote: > I haven't read/followed the whole OP Thread discussion but I thought it was > worth mentioning/recommending the Google "Guava Project": > http://code.google.com/p/guava-libraries/ > > I think they really "went to town" on that one. You have strongly typed > Immutable Collection definitions for all Java Collection types e.g. > ImmutableMap.Builder, ImmutableList.Builder. The design is awesome e.g. the > Builder pattern as prescribed in Effective Java (last edition) and the > performance gains are noticeable as well e.g. In a distributed system I have > been working on lately, switching the attribute instances of the DTO Beans > from ArrayList Java Collection to use instead the implementation from Guava > gave some noticeable 15-20% Serialization performance gain e.g. Test case > involving 1-Echo-Server and 1K-Clients. > > I really enjoy the improvement in code readability as well, it suits the > appropriate template types e.g. > > // from > List requests = new ArrayList(); > > // to > List requests = Lists.newArrayList(); > > Guava really rocks! Would this be the Java Collections design debt now > finally paid by Joshua Bloch? I'm not saying anything against Guava, but I fail to see the advantage of that particular idiom. 'Lists.newArrayList' vs. 'new ArrayList<>' - eh, mezza mezz'. Whatever floats your boat. -- Lew