Reading Effective Java, it seems that there are many advantages, and very few disadvantages, to use static factory methods. By static factory methods I specifically mean the following
public class MyClass {
private MyClass() { ... };
public static MyClass getInstance() {
return new A();
}
}
From Effective Java:
Note that a static factory method is not the same as the Factory Method pattern from Design Patterns [Gamma95, p. 107]. The static factory method described in this item has no direct equivalent in Design Patterns.
Now is it best to always follow this practice, or only sometimes?
If so when?
Is is ever overkill to do this?
In general, constructors are simpler than Factories, so this is a major reason to choose constructors over Factory. Use Factory when the situation calls for it, no “by default”. You should do the simplest thing that solves your problem, and most of the time this would be constructors.