The separation between API design and implementation is often recommended in large software implementations. But somewhere they must be reconnected (i.e., the implementation must be reconnected to the API).
The following example shows the construction of the API and the call to its implementation through the INSTANCE object:
import java.util.List; public abstract class Separation { public static final Separation INSTANCE = new SeparationImpl();
Some argue that the API should not reference implementation code. Even if we separate the API code from the implementation through separate files, we often have to import the implementation code (at least the class name) into the API.
There are methods to avoid such links using a string representation of the full name. The class is loaded by this line, and then an instance is created. This makes the code more complex.
My question is: is there any use for a full branch or isolation of the API code from the implementation code? Or is it just a purist's attempt to achieve excellence with little practical benefits?
source share