3 ms·
v2 as a suffix is ugly, so I'd probably have something like v2.DoSomething(a, b, c). Beyond that, I'd typically see a single binary serving both v1.DoSomething
by scarmig 7y ago
v2 as a suffix is ugly, so I'd probably have something like v2.DoSomething(a, b, c).
Beyond that, I'd typically see a single binary serving both v1.DoSomething and v2.DoSomething. Most of the code path would be shared, with v1.DoSomething calling the same method internally that v2.DoSomething does, except it provides some kind of reasonable default as the third argument. Vast majority of the code ends up shared.
Clients would choose which client library they prefer to use (and they can choose to use both, if they need to for whatever reason). Ideally older versions would end up deprecated over time, but it's rarer to deprecate than add a new version.