For example RPNCalculator and (Int)Sum have no Domain other than Real/Int, but usually can beforehand be restricted to an existing Domain (e.g. when Sum calculates the number of trues in a boolean array, we know it will be a PositiveInt).
Having an adapter class that can specify its Domain can be used to wrap around these kind of classes and ensure type safety.
For example RPNCalculator and (Int)Sum have no Domain other than Real/Int, but usually can beforehand be restricted to an existing Domain (e.g. when Sum calculates the number of trues in a boolean array, we know it will be a PositiveInt).
Having an adapter class that can specify its Domain can be used to wrap around these kind of classes and ensure type safety.