Operation Contracts - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Operation Contracts

Description:

Observations about the domain model objects that are true when the operation has ... Don't clutter up a use case with fine-grained details. ... – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 7
Provided by: dmitri7
Category:

less

Transcript and Presenter's Notes

Title: Operation Contracts


1
Chapter 11
  • Operation Contracts

2
Operation Contracts
  • A tool of requirements analysis (OOA) that
    describes in great detail the changes required by
    a system operation.
  • Analysis of what must happen, not how.
  • Stated in terms of postconditions
  • Observations about the domain model objects that
    are true when the operation has finished.
  • Describe state changes
  • Instance creation and deletion.
  • Attribute change of value.
  • Associations formed and broken.

3
System operations handle input system events
4
Sections of a Contract
  • Operation
  • Name of operation and parameters.
  • Cross References
  • Use cases this operation can occur within.
  • Preconditions
  • Noteworthy assumptions about state of system
    before execution of operation.
  • Postconditions
  • The state of objects in the Domain Model after
    completion of the operation.

5
An Example Contract
  • Operation enterItem( itemID ItemID, quantity
    integer )
  • Cross References Use Cases Process Sale
  • Preconditions There is a sale underway.
  • Postconditions
  • A SalesLineItem instance sli was created.
  • sli was associated with the current Sale.
  • sli.quantity became quantity.
  • sli was associated with a ProductDescription,
    based on itemID match.

6
When to use Contracts
  • High-complexity domains.
  • For system operations that are complex and
    perhaps subtle in their results.
  • Dont clutter up a use case with fine-grained
    details.
  • DONT write contracts if developers can easily
    infer what to do from the use case.
Write a Comment
User Comments (0)
About PowerShow.com