As a matter of factory, factories matter

Donald Raab
Oct 4, 2019 · 2 min read

We create collections all the time in Java, so making it easy was a priority in Eclipse Collections.

Image for post
Image for post
Factories have plural names in Eclipse Collections

Facts about the Factories

I published three blogs on the factories available in Eclipse Collections. There are static factories for each type in Eclipse Collections for both object and primitive types. The following blogs have examples of mutable, immutable and method chaining factories.

Preposition Preference

Some developers prefer factory methods named “of”. Some developers prefer factory methods named “with”. Eclipse Collections provides support for both, except when it comes to method chaining, where “with” is the only option. Read the following blog to understand how symmetry helps validate that decision.

Code Examples

Here’s a Gist showing various examples of Object and Primitive factories in Eclipse Collections.

Eclipse Collections is open for contributions. If you like the library, you can let us know by starring it on GitHub.

Oracle Groundbreakers

Aggregation of articles from Oracle engineers…

Donald Raab

Written by

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.

Oracle Groundbreakers

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, ACEs, and the developer community on all things Oracle Cloud. The views expressed are those of the authors and not necessarily of Oracle.

Donald Raab

Written by

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.

Oracle Groundbreakers

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, ACEs, and the developer community on all things Oracle Cloud. The views expressed are those of the authors and not necessarily of Oracle.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store