Design Patterns · Middle · Question 29 of 75

Where should business rules (e.g. discount calculation) live in a frontend app?

Explanation

Rules scattered across components get duplicated and are hard to test. Pure functions in entities/domain are reused across screens, on the server and in tests without rendering.

Further reading

Problem with a question

Design Patterns · Middle · question 29

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz