Most business logic is unreadable by the business. This course is about the pattern that fixes that — and about the one calculation demanding enough to prove it works.
This is a hands-on course. Every lesson has a live cell that runs on the page, and every lesson ends with something you write.
Who this is for
Developers and modellers who have to encode rules somebody else is accountable for — actuaries, accountants, risk teams, regulators. You should be comfortable reading C#. No insurance background is assumed: the domain is introduced as the course needs it, and every idea in it generalises.
The problem this course is about
A number in a financial report is not finished when it is correct. Someone has to be able to ask why it moved, get an answer in terms of causes rather than code, and trust that the answer adds up. That forces three things on your rules, and most codebases get none of them:
- the rule must be readable by the person accountable for it, not just its author;
- the choice of which rule applies must be as reviewable as the rule itself;
- the result must reconcile — and fail loudly when it does not.
What you'll be able to do at the end
- Model a calculation as scopes: identity, storage, and a memoized graph of derived values
- Express "the same quantity, computed differently in this case" with
WithApplicability— and know why the ordering is load-bearing - Use context so one formula serves several bases without duplicating a line
- Decompose a movement into steps with telescopic differences, so the report reconciles by construction
- Handle hierarchies, currency translation and consolidation without double-counting or smearing the FX effect
- Recognise when a residual is a real cause worth naming, and when it is a defect you are about to hide
How each lesson works
| Band | What it is |
|---|---|
| 📖 Theory | The idea, kept short, with the real code from the shipped module. |
| ⚡ Experience it | A live cell. It runs when the page loads — read it, then predict what a change would do. |
| ✍️ Your turn | A small exercise. A Peek at the solution link is always one click away. |
The syllabus
Part 1 — Rules as scopes
- Why business rules
- The scope: identity, storage, graph
- Applicability: one quantity, several implementations
- Context: one formula, several bases
Part 2 — Modelling the domain
Part 3 — Valuation
Part 4 — Currency and consolidation
Part 5 — The report
The worked example
Everything runs on one book — a Swiss endowment, a dollar-denominated annuity held by a euro entity, and a non-life claims run-off — and the code is the real code from the IFRS 17 module that ships with the platform. The numbers in these lessons are the numbers its tests pin. Nothing here is a simplification written for teaching.
Ready? Start with Lesson 1 — Why business rules.