One use of this pattern is during software rewrites. Code can be divided into many small sections, wrapped with the strangler fig pattern, then that section of old code can be swapped out with new code before moving on to the next section. This is less risky and more incremental than swapping out the entire piece of software.4
The strangler fig pattern can be used on monolithic applications to migrate them to a microservices architecture.56
Another use of this pattern is the addition of logging to old code. For example, logging can be used to see how frequently the code is used in production, which can be used to decide whether to delete low-usage code, or to rewrite high-usage code.7
Newman, Sam (2020). Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith. O'Reilly Media. pp. 79–97. ISBN 978-1-492-07554-7. 978-1-492-07554-7 ↩
Carlo, Nicolas. "The Ship of Theseus to NOT rewrite a legacy system from scratch". Understand Legacy Code. https://understandlegacycode.com/blog/ship-of-theseus-avoid-rewrite-legacy-system/ ↩
Seemann, Mark (2022). Code That Fits in Your Head: Heuristics for Software Engineering. Addison-Wesley. pp. 228–237. ISBN 978-0-13-746440-1. 978-0-13-746440-1 ↩
Behara, Samir (12 December 2018). "Monolith to Microservices With the Strangler Pattern". DZone. Retrieved 12 March 2024. https://dzone.com/articles/monolith-to-microservices-with-the-strangler-patte ↩
Clausen, Christian (2021). Five Lines of Code: How and when to refactor. Manning Publications. pp. 206–208. ISBN 9781617298318. 9781617298318 ↩