Architecture & practice·Legacy systems and migration
you put an interface in front of the old code, added the new one behind the same interface, and switched with a flag.
Branch by abstraction
Making a large change on the main branch by introducing an abstraction over the existing implementation, building the replacement behind it, and switching over. It exists because the alternative — a long-lived branch for a big migration — reliably ends in a merge nobody can review. The abstraction is temporary and should be removed once the old path is gone, which is the step most teams forget.