The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
Google's Guava Libraries for JDK 1.6

8 replies on 1 page. Most recent reply: Oct 2, 2009 4:20 PM by John Zabroski

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 8 replies on 1 page
Frank Sommers

Posts: 2616
Nickname: fsommers
Registered: Jan, 2002

Google's Guava Libraries for JDK 1.6 Posted: Sep 25, 2009 12:52 AM
Reply to this message Reply
Advertisement

Google recently open-sourced a series of libraries it uses in internal Java projects. The aim of the Guava libraries is to enrich the core JDK 1.6 APIs, providing missing functionality for common use-cases. In its current release, Guava includes three packages: com.google.common.primitives, com.google.common.io, and com.google.common.util.concurrent. Additional libraries will also be made available for networking-related tasks, collections, and reflection.

Since the main goal of the Guava libraries is to provide features for common use-cases that are not part of the JDK, it addresses programming issues as fundamental as working with primitive values. For example, a series of classes in the library provide rich interfaces for String and character manipulation, such as matching String patterns or joining Strings together by a common pattern. The primitives package also provides APIs to make it easier to work Ints, Bytes, and other Java primitive values.The io sub-package, in turn, provides convenient utilities to work with byte and character streams, as well as for reading and writing files.

The Guava APIs work on JDK 1.6, but they may also be used on other Java platforms, such as Android and the Google App Engine.

What do you think of the Guava project?


Kondwani Mkandawire

Posts: 507
Nickname: spike
Registered: Aug, 2004

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 25, 2009 3:16 AM
Reply to this message Reply
Like the CharMatcher, its like StringUtil on Steriods :o)

Humberto Madeira

Posts: 3
Nickname: kunakida
Registered: Apr, 2008

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 25, 2009 6:20 PM
Reply to this message Reply
What do I think of the Guava project?

Not very much.

Any Java programmer who's been around awhile will already have accumulated most of these types of utility classes.

And if not, then they can also use the Apache Commons at http://commons.apache.org

Most of the Commons components tend to support back to JDK 1.4 or 1.3 and since Apache Commons has a much longer history, there are more of them to choose from.

And "like Guava" they are "also" Apache 2.0 licenced.

The main thing Guava introduces is an unwanted dependency on JDK 1.6

Unless you need something specific in it and you don't mind the JDK 1.6 constraint - then I would suggest avoiding it.

John Zabroski

Posts: 157
Nickname: zbo
Registered: Jan, 2007

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 25, 2009 6:56 PM
Reply to this message Reply
> And if not, then they can also use the Apache Commons at
> http://commons.apache.org

Commons has a lot of poorly implemented crap, too.

Code review is pretty much non-existent there.


What do I think of the Guava project?

It's interesting to see what Google engineers put out. You then know exactly where you stand among the alleged best of the best.

I also think this is good for Google in general. New hires can more quickly dive right in if they know Google's core APIs and ideas (i.e., MapReduce). This is what Google wants. It takes time to learn APIs, and so it only makes sense to open source stuff that is not critical to operations.

Nick Evgeniev

Posts: 16
Nickname: nevgeniev
Registered: Aug, 2007

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 25, 2009 7:26 PM
Reply to this message Reply
Agree with John, would not say for all apache java projects, but commons is a crap indeed.

Jess Holle

Posts: 13
Nickname: jessh
Registered: Jan, 2009

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 27, 2009 10:34 AM
Reply to this message Reply
> The main thing Guava introduces is an unwanted dependency
> on JDK 1.6
>
> Unless you need something specific in it and you don't
> mind the JDK 1.6 constraint - then I would suggest
> avoiding it.

For those who have already moved on to require Java 6 (Sun ends Java 5 support next month after all except for those who pay for extended support), having libraries that exclude pre-Java-6 cruft is a real bonus.

It's way past time for developers to be requiring Java 6. Even the ever so slow to update IBM produced a version of WebSphere that supports Java 6 some time ago. If you're still using something that does not support Java 6, then it's time to update to a later version that does.

Jess Holle

Posts: 13
Nickname: jessh
Registered: Jan, 2009

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 27, 2009 10:42 AM
Reply to this message Reply
> It's way past time for developers to be requiring Java 6.
> Even the ever so slow to update IBM produced a version of
> f WebSphere that supports Java 6 some time ago. If you're
> still using something that does not support Java 6, then
> it's time to update to a later version that does.

P.S. Yes, I do know that Java ME is stuck back in a pre-Java-5 world. This is purely utterly ridiculous. Sure, I understand cell phone companies won't update existing phones to contain new JVMs, but people update (churn) phones pretty quickly. The issue is that those driving Java ME, most especially including the handset folk, clearly have no interest in biting the bullet and doing what it takes (including updating the ME standard) to get Java ME phones that ship today to be compatible with today's version of Java. No wonder Google had to introduce Android -- Java ME is an anachronism. Google wants to use the latest and greatest Java version and libraries which leverage it *everywhere* (remember WORA). The ME spec folk don't seem to care that they're creating an isolated backwards technical space.

James Watson

Posts: 1827
Nickname: watson
Registered: Sep, 2005

Re: Google's Guava Libraries for JDK 1.6 Posted: Sep 30, 2009 9:58 AM
Reply to this message Reply
> It's interesting to see what Google engineers put out.
> You then know exactly where you stand among the alleged
> d best of the best.

I took a look at the ByteStreams copy method and it will likely perform slowly on may stream classes. In informal testing, I've found the approach they use (single byte) to be about 30 times slower for disk IO than a buffered approach.

John Zabroski

Posts: 157
Nickname: zbo
Registered: Jan, 2007

Re: Google's Guava Libraries for JDK 1.6 Posted: Oct 2, 2009 4:20 PM
Reply to this message Reply
> > It's interesting to see what Google engineers put out.
> > You then know exactly where you stand among the alleged
> > d best of the best.
>
> I took a look at the ByteStreams copy method and it will
> likely perform slowly on may stream classes. In informal
> testing, I've found the approach they use (single byte) to
> be about 30 times slower for disk IO than a buffered
> approach.

I thought static analysis tools Google uses would check this. I guess they don't use PMD or something equivalent. Well, that's revealing. I would expect big companies to have somebody whose full-time job is incorporating this stuff.

Flat View: This topic has 8 replies on 1 page
Topic: Abstract Type Members versus Generic Type Parameters in Scala Previous Topic   Next Topic Topic: The Perils of Negative Scalability


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us