Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Google Collections Library and Apache Commons collection

Posted on 2014-03-26
2
330 Views
Last Modified: 2014-04-24
Google Collections library from Google Core Libraries for Java 1.6 (Guava) can be an alternative to Apache commons collection library.


Hi,
 I read as above. I wonder when to use use Google Collections Library and when to use Apache Commons collection. What are advantages, disadvantage, practical uses of each of them.
please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
2 Comments
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 250 total points
ID: 39957788
While one MAY be an alternative for the other, it that they cover the same general functionality, they would still do these same things in slightly/vastly different ways. Also, each one would also do somethings that the other doesn't.

So the decision would probably come down to... Which one covers more of the functionality that you are after in any particular project? It is quite likely that different projects that you are coding will have different requirements and so you would use Google for some projects and Apache for others. We can't really say much more because it is entirely dependant on exactly what you want to achieve.

Also, the last possibilty is that you don't choose between them at all and instead utilise BOTH libraries in the one project, so that some parts of the code can use one and other parts use the other.
0
 
LVL 27

Accepted Solution

by:
dpearson earned 250 total points
ID: 39958186
In general I think you'll find the Google (Guava) library will be the one to use if you have no strong reason to prefer Apache Commons.

The reason is just that Guava was written more recently - so they had access to everything in Apache Commons and also the Java collection classes when they wrote their libraries.

So usually I think Guava will be the better choice these days, although that's just a rule of thumb.

Doug
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTTPSessionBindingListernter not configured in deployment descriptor 2 65
servlet  URL Rewriting 1 42
iterator/ListIterator approach 17 39
how to debug htl and js pages 8 38
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question