13.8. Guidelines: Contracts
Apply the following advice to create contracts:
To make contracts:
|
Advice on Writing Contracts
State the postconditions in a declarative, passive past tense form (was …) to emphasize the declaration of a state change rather than a design of how it is going to be achieved. For example:
(better) A SalesLineItem was created.
(worse) Create a SalesLineItem.
Remember to establish a memory between ...
Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.