What is a factory and why would I want to use one?
The factory is an object, that creates objects. The common usage includes two cases:
Integer.valueOf(), which is a so-called factory method) or choose a concrete implementation depending on some conditions - e.g. supplied argument or pre-defined options (see XPathFactory class in Java API for XML Processing)SomeFactory in a generic method).