Guard Methods

added by rdingwall
4/8/2010 5:25:47 AM

0 Kicks, 81 Views

In defensive programming, guard clauses are used to protect your methods from invalid parameters. In design by contract, guard clauses are known as preconditions, and in domain driven design, we use them to protect invariants — unbreakable rules that form assumptions about our model.