Guard Methods

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

88 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.


0 comments