Solved

Google Collections Library and Apache Commons collection

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

757 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

21 Experts available now in Live!

Get 1:1 Help Now