Assuming we have a REST API (Implemented using springs RestController) that is accessed from remote as well as the same local machine (e.g. mobile phone client and some mvc component on the same server).
For local software components on the same machine i guess there are two extremes:
- Either they perform actual HTTP requests on the local machine possibly introducing significant unnecessary overhead
- Or they somehow call the implementation of the REST API directly through Java, possibly introducing too much knowledge about the API implementation to the dependent software component
Is there any recommended middle ground for spring-based applications? Some bypass that is optimized for local execution but does keep the API as a black-box?
Thanks