this post was submitted on 19 Nov 2025
6 points (100.0% liked)

Experienced Devs

4978 readers
3 users here now

A community for discussion amongst professional software developers.

Posts should be relevant to those well into their careers.

For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Kache@lemmy.zip 1 points 1 day ago* (last edited 1 day ago)

Yeah, this should be common software engineering problem for a senior engineer

In the beginning, there is only one data model used both externally and internally, to keep things simple. Now that they're diverging, it's time to draw an abstraction boundary that translates between internal and external models.

I'm not super strong with Java, but subclassing to handle v1/v2/vX doesn't sound like the right thing to do. I'd detach the old model from the API while otherwise keeping it unchanged, implement a new pathway to connect with the new API, then translate in/out of the old model before it passes into the existing system. This way, the surface area of change and of integration is isolated and decoupled from everything else.