Java has long had a relationship with Factory Method, usually calling it by the more degenerative term "Factory" or "Factory pattern". (Technically, what Java calls a "Factory pattern" is typically one of Builder, Abstract Factory, or Factory Method, depending on what precisely looks to be varied and/or encapsulated.)

Java has a number of Factory Method implementations already in its standard library:

Frankly, all three of these were an awesome example of a case where the use of the pattern was wildly overblown, based on the thought process at the time (the '99/2000 timeframe) that Java developers would want to change up their XML parser implementation without having to change any code. That never really happened.

Last updated: 28 February 2022

Tags: pattern implementation   creational   java