4 ms·
Some people on this thread are talking about the java interface keyword in general whereas it seems to me OP is talking specifically about interfaces to backing
by durazabu 4y ago
Some people on this thread are talking about the java interface keyword in general whereas it seems to me OP is talking specifically about interfaces to backing services [0].
[0] https://12factor.net/backing-services https://12factor.net/backing-services
- Yhippa 4y agoI read that and it seems conceptually similar to the intent of Java interfaces FWIW.
- durazabu 4y agoI mean using Java interfaces for backing services, as opposed to using Java interfaces for every Java classes.
- hardwaresofton 4y agoWell that I actually just take that idea as gospel/the basics at this point. In 2022 most applications should be doing things like relying on REDIS_HOST or REDIS_URL as ENV/config and using that to connect. 12factor enshrined these ideas and it's the way to go, I think. That said, the services that I mentioned where I wanted this pattern actually already do treat their backing services this way, so the idea is more about the general idea of an code-level interface.
- durazabu 4y agoYes, you go further than 12 factors with my favorite point of the article: > It’s much better to have a DataBackend that has implementations like Postgres14DataBackend and MySQL8DataBackend rather than just changing the driver: 'postgres' to driver: 'mysql' in some configuration file.