SPIN Constraints | TopQuadrant, Inc

+1 919.300.7945     Blog     Downloads     Purchase     Contact

SPIN CONSTRAINTS

SPIN Constraints provide support for validating the values of data entries

Example of Constraint Checking

The following screenshot provides an example of a SPIN constraint definition. Constraints are conditions or unit tests that all instances of a class (and its subclasses) must fulfill at any time. Constraint violations can be useful to guide input and to verify a model's state.

Constraint Checking Example

The constraint shown above is an ASK query that checks whether the values of the property age are within a reasonable range. If a Person has an age less than 0 or greater than 120, a constraint violation will be issued and TopBraid Composer will display warnings at suitable places on the form, as shown below. Note that SPIN uses the system variable ?this to refer to the current instance of the class to check.

Constraint Check Violation

About TopQuadrant | Glossary | Privacy Statement | Legal | Terms of Use
© Copyright 2001-2017 TopQuadrant, Inc. All Rights Reserved.