a) Scoping the responsibilities

It is for example impossible to check statically that a number is prime. Nevertheless, by defining a type for prime numbers, one can easily check that given objects are of compliant types. This does not remove an actual run-time dependency: some instances of complying but incorrect types might happen to have non-trivial factors, thus invalidating existing client code. Typing does, however, help to scope the responsibility, and thus make it less likely for such errors to occur.

Table of contents


Marc Girod
Last modified: Sat Feb 28 14:23:16 EET 1998