Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Google Collections Library and Apache Commons collection

Posted on 2014-03-26
2
Medium Priority
?
381 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
[X]
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
2 Comments
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 1000 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 28

Accepted Solution

by:
dpearson earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
A solution for Fortify Path Manipulation.
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

670 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