4

I recently stumbled across Eclipse Collections, and they look awesome - pretty much about as awesome as Java 8 streams looked. I read through a few introductions, presentations and tutorials, and it seems like pretty much everything EC added, you can do with streams nowadays.

Without in any way meaning to put down EC, is there any value the library still adds now that we have streams, that maybe got glossed over in what I read ? Or did it essentially go the way of Joda time; being so good that it got adopted into Java pretty much verbatim negating the need for the library ?

Torque
  • 3,319
  • 2
  • 27
  • 39
  • 3
    I disagree with the too broad close flag. This is an interesting question that does hold merit to java programming in general. I would however suggest you include some sample code of elements that have vanished and what a replacement would be. – Tschallacka Apr 20 '18 at 09:54
  • @Tschallacka if you look at https://github.com/eclipse/eclipse-collections/blob/master/docs/guide.md it lists a ton of EC solutions right next to their Java 8 Stream solutions, and they mostly look about the same or similar – Torque Apr 20 '18 at 10:03
  • 2
    I am the creator of Eclipse Collections (EC), and am still an active committer. My brief answers to questions in order since I am limited now to a comment. 1. No. 2. Yes. 3. Not yet, but I hope one day it might emulate Joda's evolution and become part of the JDK. Nikhil Nanivadekar (current EC project lead) and I gave an API Deep Dive presentation at JavaOne 2017 which might give you some more useful info about what EC adds beyond JDK Collections and Streams: http://eclipse.github.io/eclipse-collections-kata/api-design. Thank you for the compliments. – Donald Raab Apr 21 '18 at 06:03
  • 1
    EC 9.1 release blog: https://medium.com/@donraab/eclipse-collections-9-1-released-24c413d200ec – Donald Raab Apr 21 '18 at 06:28
  • 2
    This question should be opened so that the library maintainers (me being one of them) gets an opportunity to reply. – Nikhil Nanivadekar Apr 22 '18 at 12:14
  • 1
    Since this question is closed, I answered it on Medium https://medium.com/@motlin/java-has-streams-do-we-need-third-party-collections-dd12f473d105 – Craig P. Motlin May 15 '18 at 23:19

1 Answers1

3

From https://www.eclipse.org/collections/

History of Eclipse Collections
The origin of Eclipse Collections was started off as a collections framework named Caramel at Goldman Sachs in 2004. Since then the framework has evolved, and in 2012, it was open sourced to GitHub as a project called GS Collections.

GS Collections has been presented at number of conferences including JVM Summit in 2012 and JavaOne in 2014. A performance comparison between the parallel lazy implementations of Java 8, Scala and GS Collections was presented at QCon New York in 2014. Also articles about GS Collections (Part1 / Part2) have published on InfoQ.com showing some of the capabilities of the collections framework through examples, and also interviews to the creator of GS Collections.

Over the years, around 40 or so developers from the same company have contributed to the collections framework.

To maximize the best nature of open source project, GS Collections has been migrated to the Eclipse Foundation, re-branded as Eclipse Collections in 2015. Now the framework is fully open to the community, accepting contributions!

It seems it still alive. And if you read the above page it's fully operational with java 8 lambda's.

boolean anyPeopleHaveCats =
  this.people
    .anySatisfy(person -> person.hasPet(PetType.CAT));

boolean anyPeopleHaveCats =
  this.people
    .stream()
    .anyMatch(person -> person.hasPet(PetType.CAT));

When you look at the repository at https://github.com/eclipse/eclipse-collections you can see that there are still contributions made and merged into it.

So I would say it's not deprecated, but an extra feature of ready to use methods you can use with your own code and java streams to make streaming a bit easier.

It still adds easy comparator functions etc.. so you don't have to write your own, you can just implement a ready to use lamda method or stream parser that suit your needs. It does seem superfluous, because anySatisfy seems a lot like filter, but it does add a lot of clarity to the code by writing out what exactly is expected to happen in the code itself.
The stacks and Bags seem useful to me under certain circumstances. And sometimes you don't want to use streams because it's a small collection(1000 or less), making the overhead of streams initialization is not worth it. And this makes it a lot easier to write smaller code that performs better.

It might not be as useful essential as before java8, but there is still a place for it.

Tschallacka
  • 27,901
  • 14
  • 88
  • 133
  • 1
    I did not mean to suggest that the project was dead, just like Joda Time isn't dead, merely that there seemed to be little use to adopt it in a new project. – Torque Apr 20 '18 at 10:00
  • 2
    this.people.anySatisfyWith(Person::hasPet, PetType.CAT) is an example of something Eclipse Collections adds across most of its direct APIs that give more opportunities for method reference usage. There are more examples of the "With" methods towards the end of this DZone article: https://dzone.com/articles/preposition-preference – Donald Raab Apr 21 '18 at 06:12