Feature Toggles vs Feature Branches

前端 未结 3 2043
无人及你
无人及你 2020-12-12 19:41

What are \"Feature Toggles\" and \"Feature Branches\" and what\'s the difference between them?

What are the pros and cons? Why is one better than the other?

3条回答
  •  Happy的楠姐
    2020-12-12 19:42

    I discuss this in depth on my blog: http://geekswithblogs.net/Optikal/archive/2013/02/10/152069.aspx

    In short, feature branches will give you better isolation, but require you to deal with the pain of deferred integration, and merges. Toggles give you continuous integration, but require you to design/implement your code in such a way that supports toggles, and introduce the risk that unfinished feature code could negatively affect production.

    You can use both branches and toggles together (they aren't mutually exclusive). As far as deciding which one to use in each scenario, my thoughts are that toggles should be the default choice unless the following are true:

    • hard to hide the functionality behind a toggle
    • has a potential impact on an area of the application that doesn't have thorough tests

    If either of those conditions are true, I would probably use a feature branch instead of toggle.

提交回复
热议问题