I am working on an API, and one of my teammates insists that it is better to return interfaces than to return specific objects to the end user.
The problem is that as the coding of the API continues, the maintainability of the interfaces becomes difficult, if we need to add something like a parameter to the interface method, then we need to add it to the interface first, and then add this method to all the others classes that inherit from this interface.
This made us doubt the benefits of these interfaces and their maintainability, is there really a good reason to expose only the APIs?
source
share