Home > Java > Guava is an heavyweight library and I would like this to change

Guava is an heavyweight library and I would like this to change

Google Guava is an useful library that offers many different but unrelated features:

However, this article is not about those features but about offering a single heavyweight Uber JAR for all. From Google’s point-of-view, providing an Uber library for all projects makes sense: “Hey guys, just add this dependency and it will meet your every requirement”. However, from my point of view, this is just making my applications heavier.

Cohesion is at the root of good software development. Many framework providers, such as Spring and JBoss, release nicely cohesive packages and manage dependencies between them through a Dependency Management tool. What is strange is that most Guava’s features are not coupled together, so a having single library is not mandatory. Even stranger, Guava has previously been released in different JARs but Google stopped doing that with version r03.

I have found no solution beside creating separate JARs and handling dependencies myself, then storing them in a Maven Enterprise Repository. Since these tasks are required for each release, I never found the ROI interesting enough. The easiest way would be for Google to do that at build time.

Dear Google engineers, if by chance you happen to stumble upon this article, I’d be very grateful if you’d consider it.

email
Send to Kindle
Categories: Java Tags: ,
  1. Louis Wasserman
    January 12th, 2014 at 21:03 | #1

    This has been discussed fairly exhaustively at https://code.google.com/p/guava-libraries/issues/detail?id=605

  2. Stevo Slavic
    January 12th, 2014 at 21:13 | #2

    Hello Nicolas,

    You’re not the first one to request this. See http://code.google.com/p/guava-libraries/issues/detail?id=1329

    Kind regards,
    Stevo

  3. Nicolas Rémond
    January 12th, 2014 at 23:41 | #3

    That is an issue that has been discussed thousands of times and the official position of the Guava-team is: use ProGuard, cf https://code.google.com/p/guava-libraries/wiki/UsingProGuardWithGuava

    All the guys doing Android code have to deal with it.

  4. January 17th, 2014 at 22:41 | #4

    Thanks all for your input. However, by using ProGuard, every user has to make the configuration by himself, whereas other providers do that as a standard.

    Moreover, I tend to frown upon arguments such as “We would add a lot of administrative overhead”.

    However, thanks to your pointers, I stumbled upon this unofficial distribution.

  1. No trackbacks yet.