Branch by Abstraction
Last Modified on
devops
The Branch by Abstraction pattern allows for incremental and large-scale changes to a code base over time. By introducing an abstraction layer over top of the older code, you can easily change out the underlying behaviour without changing the published API.
As an example, this pattern could be used when converting the back end processing of an algorithm from one provider to another, flom local to remote processing, or vice versa.
This pattern is also known as the strangler.
Details
To apply this pattern:
- create an abstraction layer over the system you want to replace
- refactor the remainder of the system to use the abstraction layer
- create new classes/services/etc and delegate over time
- the abstraction layer calls the appropriate old or new subsystem
- when complete, you can remove the abstraction layer if you want
Related Notes
- Expand-Contract Migrations
- Refactoring MOC