当新功能需要对代码库进行大量更改时,如何处理功能切换?
功能切换非常适合新功能 - 在大多数情况下,功能应该简单地被一些 UI 容器包围,这些 UI 容器将基于功能配置可见或不可见。但是,如果新功能需要对现有代码库进行大量更改,如何使用功能切换呢?我无法使用“复制&”更改”,因为显然它比功能分支要糟糕得多 - 我不会遇到任何合并冲突。那么满足此类要求的最佳实践是什么?
Feature toggling works perfectly for a new functionality - in most cases the functionality should be simply surrounded with some UI container that will be visible or not based on feature configuration. But how feature toggling could be used if a new feature requires massive changes in existing code base? I can not use 'copy & change', because obviously it is much worse than feature branching - I'll not get any merge conflicts. So what are the best practices for such requirements?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将功能切换与 IoC 容器结合起来,以加载组件的不同实现。例如,切换“A”加载实现“X”,而切换“B”加载实现“Y”。这种方法将允许您维护并行实现并基于单个切换打开旧功能和新功能。
You can combine feature toggling with an IoC container to load different implementations of your components. For example, toggle "A" loads implementation "X" while toggle "B" loads implementation "Y". This approach would permit you to maintain parallel implementations and turn on legacy and new functionality based on a single toggle.