This page is part of my personal knowledge database, that helps me to store and navigate my learnings.
Read on here for details

Branch By Abstraction

ยท 1 minute read

The Branch By Abstraction pattern describes the injection of an abstraction layer within a software system, so that the part “behind the abstraction” can be switched out.

Initially, the system is directly accessed by other components:

Branch By Abstraction - Initial.svg

As a first step, an abstraction is created, through which all direct access by the components happens henceforth:

Branch By Abstraction - Step 1.svg

Then the old system can be easily replaced by a new system.

Branch By Abstraction - Step 2.svg

Assuming the developers worked cleanly, this can be easy as providing a new implementation for an existing interface, or as complicated as conceptual scoping and separating the system-to-be-replaced, then defining an interface, then making the existing system the implementation, then replacing.

This pattern works on multiple levels of granularity, e.g.

Sources

Related