For Java developers, this is a book for your desk, not just your bookshelf. With over 200 color syntax highlighted code examples, Eclipse Collections Categorically shows how to make your Java collections code easier to write and review. More than a coder’s cookbook, Eclipse Collections Categorically recounts how the author organized a formidable Java interface with over a hundred methods into basic functional categories, such as counting, filtering, aggregating, and converting.
It’s a chronicle of one developer’s journey, interwoven with insights into how code can be written concisely and with elegance. It details strategies for making a large-scale application programming interface easier for developers to understand. A bird’s-eye view of the Eclipse Collections open source library and its counterparts coupled with a street-level take on the design decisions that go into creating and enhancing an API of any kind, in any language.
Collections handling is at the heart of computing. The algorithms for creating, inspecting, converting, filtering and combining data collections are vital parts of any developer’s toolkit. In an object-oriented language, collections can and should be more than simply receptacles for data. They can also incorporate the actions—the methods—for acting on the data they hold. The collections themselves provide the necessary logic. That is one key innovation of Eclipse Collections for Java developers.
I wish “Eclipse Collections Categorically: Level up your programming game” existed when I first use Eclipse Collections. n the preface, Don compares Clipper, Smalltalk and Java (pre Java 8) to give a feel for the differences in syntax. Eclipse Collections was invented before Java supported lambdas so this is helpful in understanding the environment it was created in. There's also an appendix with more on Smalltalk which I found interesting. Speaking of history, Don goes briefly explains 20 years of this library evolving from Caramel to Gs Collections to Eclipse collections.
The bulk of the book is going through the features of the library with annotated examples. There are useful comparison throughout like to Streams. Things not available in the JDK like using of() with a SortedSet are highlighted. I especially liked the feature compare collect() in JDK streams vs Eclipse Collections.
Concepts are well explained like eager vs lazy. The code examples are fun and there are some running themes like United States Presidents are used in a bunch of examples.
Chapter 11 was great by pulling together concepts from earlier in the book. I hadn't picked up on the term “fused methods” earlier on.
Also, the book is in color which is great for some of the diagrams (like class/interface diagrams) and makes the code feel very much like an IDE. Speaking of code examples, most of them have a “cost” visual showing how easy or hard they are to read. And there's a table early on in the book showing how that cost is calculated if curious. You don't need to remember that though. The cost is comparative so ones with a lower cost are definitely easier to read.
Chapters end with a table summarizing the APIs covered. With over 200 code examples and over 50 reference tables, this book is great for learning the library, deepening your understanding of it or even appreciating it more. (This matches the target audience of Java devs who have or haven't used Eclipse collection along with library designers.) Thanks Don!
This book is a great aid for those wanting to learn about Eclipse Collections and to make their Java code more concise, comprehensible, and capable.
But there is more! This book also presents a useful way of exploring and understanding feature-rich software frameworks. It does so by introducing dimensions of patterns and categories that become a natural way to organize an API surface of any non-trivial size. Taming complexity is a problem not just for framework users, but also (and perhaps especially so) for framework writers, and both groups can benefit from adopting this approach.
Also, while it may seem like a small detail, having the code samples in full color makes the book much more effective and engaging: along with syntax highlighting one would expect from a modern IDE, additional color coding draws the reader’s attention to parts of the code that demonstrate essential concepts or techniques.