Files
java-design-patterns/feature-toggle
Stefanel Stan a05cf33643 refactoring: Issues #2326 and #2325 (#2327)
* Fix comment typo #2325

* Minor enchancements to flyweight #2326

* Minor enchancements to flyweight #2326
2022-11-20 15:14:13 +02:00
..
2019-12-07 18:03:49 +02:00
2022-09-14 23:22:24 +05:30

title, category, language, tags
title category language tags
Feature Toggle Behavioral en
Extensibility

Also known as

Feature Flag

Intent

Used to switch code execution paths based on properties or groupings. Allowing new features to be released, tested and rolled out. Allowing switching back to the older feature quickly if needed. It should be noted that this pattern, can easily introduce code complexity. There is also cause for concern that the old feature that the toggle is eventually going to phase out is never removed, causing redundant code smells and increased maintainability.

Class diagram

alt text

Applicability

Use the Feature Toggle pattern when

  • Giving different features to different users.
  • Rolling out a new feature incrementally.
  • Switching between development and production environments.

Credits