# Weekly Deals: Pass the Rule In

When this week's deal is picked by a switch inside checkout, every new deal means editing the code that handles the money; handing the deal into checkout as a function, the Strategy pattern in its simplest form, lets a new deal be written without touching checkout at all.

![Cheat sheet: Weekly Deals: Pass the Rule In](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/f5b91fa55afc49dd9103759ce57140c4.webp)

- Category: Data Structures
- Level: Apprentice
- Tags: Code Smell, Higher-Order Function, OOP, Strategy Pattern
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-weekly-deals-cheat-sheet
