On a page twelve of “Java concurrency in practice” there is a phrase
“A good specification defines invariants constraining an object’s
state and post – conditions describing the effect of its operation.”
More or less I undersand the phrase untill the word "post"
, then it becomes a garbage.
Can you help please?
Perhaps the spacing is confusing. The last part of the sentence should read “post-conditions describing the effect of its operation”, or what must be true about the state of the object following the completion of a method call (or any other code block).
Post-conditions, along with preconditions and invariants, are frequently used in design by contract. Having a formal specification does help in understanding concurrency and the side-effects of a method call. It’s also useful in establishing test code and assertions.
2