If you have a lot of duplicated code that is prone to often change together, then you will benefit from extracting a common abstraction. As you can see there are a lot of conditions:
- Lots of duplicates
- The change is often. Not once a year
- They change together in one direction. What I often see is that features start similar and then evolve into different directions, and it becomes increasingly expensive to support multiple use cases in one abstraction. What was, in the beginning, a duplicate is now 2 different things. The trick is you do not know the future from the start, it’s a gamble investment to extract abstractions early
Check my article. Folks from Cambridge introduced layers upon layers with single implementations. This is tons of work for nothing. And they are not alone, I was like that too.