13.9. NextGen POS Example: Contracts

System Operations of Process Sale

Contract CO1: makeNewSale

Operation:makeNewSale()
Cross References:

Use Cases: Process Sale

Preconditions:none
Postconditions:

- A Sale instance s was created (instance creation).

- s was associated with the Register (association formed).

- Attributes of s were initialized.

Note the vague description in the last post-condition. If sufficient, this is fine.

On a project, all these particular postconditions are so obvious from the use case that the makeNewSale contract should probably not be written.

Recall one of the guiding principles of healthy process and the UP: Keep it as light as possible, and avoid all artifacts unless they really add value.

Contract CO2: enterItem

Operation: ...

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.