Introduction
Property validation logic helps check if the values given to an object are correct. It stops wrong data from being saved.
When you want to make sure a user's age is not negative.
When you need to check if a name is not empty before saving.
When you want to limit a score to a certain range.
When you want to prevent invalid data from breaking your program.
When you want to give clear errors if data is wrong.