How to deal with function switching when a new function requires significant changes in the code base?

The switching function works fine for new functionality - in most cases, the functionality should simply be surrounded by some container of the user interface, which will be visible or not based on the configuration of functions. But how can functions be switched if a new function requires significant changes in the existing code base? I cannot use “copy and modify” because obviously this is much worse than the branch function - I will not get merge conflicts. So what are the best methods for such requirements?

+4
source share
1 answer

You can combine function switching with an IoC container to load various implementations of your components. For example, toggle "A" loads the implementation of "X", and the switch "B" loads the implementation of "Y". This approach allows you to support parallel implementations and include legacy and new features based on a single switch.

+1
source

Source: https://habr.com/ru/post/1398025/


All Articles