Solved

Google Collections Library and Apache Commons collection

Posted on 2014-03-26
2
319 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 26

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now