2 ms·
There are at least two ways to change an API without breaking it: * Adding a new method to the API does not break the API. * In certain language/middleware co
by lowbloodsugar 11y ago
There are at least two ways to change an API without breaking it:
* Adding a new method to the API does not break the API.
* In certain language/middleware combinations, adding new properties to a parameter object does not break the API.
If we have a method that needs to change, we add a new method. New clients use the new method, and we support old clients until they are retired. When using JAX-RS, we can add new properties to JSON objects provided they are annotated correctly.
- wvenable 11y agoYou effectively have to maintain a backwards compatible system but that limits the amount of change that you can really do. It also definitely makes the system more complicated but more stable. That's the trade off. If you're constantly changing/breaking the API then that's just a monolith in micro-service clothing. But the system can be simpler and you can make more significant changes quicker.
- lowbloodsugar 11y agoIf you think of "the system" as the entire suite of applications across space and time, then the one approach is no more complicated than the other. One involves some effort thinking about backwards compatibility, the other with trying to get a bunch of teams to all commit to the right branch, and then get it integrated at the same time. My experience is that the latter proves far more disruptive to production. One of our groups (the monolith team) has one month code freezes while they integrate all the teams work into the latest monolith. Our teams really have no limits on the changes they can do. If the change really is so complex that it requires changing every system, then we just build another system with zero dependencies. In fact we did that once. Got it working really fast. Usually branch-by-abstraction resolves any big issues, while updated method objects or just new methods handle most "changes". Granted, this is with several hundred developers across multiple engineering departments. YMMV.