| |
| Recipe 9.16: Placing Postconditions on Method Arguments |
Last Updated: Sep 8, 2003
Status: Draft
|
|
|
|
How important is this problem to you?
(Login to Vote)
5.00 Rating, 1 Vote
|
|
How acceptable is the proposed solution?
(Login to Vote)
0.00 Rating, 0 Votes
|
|
Problem:
   
Your method alters one of its arguments: you want to place a postcondition on that argument to ensure that the returned value is valid. You want the validity check to be part of the method interface, so that it is performed regardless of the method implementation.
Solution:
Discussion:
(If the value is not rw, postconditions are useless)
(I'd probably rather associate multiple preconditions with the method itself, since that's more powerful and would make this obselete?)
|
|