Download presentation
Presentation is loading. Please wait.
1
ACS-3913Fall 2009 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions; assertions are applicable to any element of the UML text discusses contracts for system operations; contracts are applicable to execution of any software component
2
ACS-3913Fall 2009 Ron McFadyen2 Domain Model Use Case Model text diagram SSD System operation contracts Design Model
3
ACS-3913Fall 2009 Ron McFadyen3 Contracts A contract is a technique for describing system operations in terms of state changes to objects in a Domain Model Contracts are based on work by Bertrand Meyer … Eiffel programming language and the concept of assertion a statement, a constraint or declaration, that must be true a false value indicates a bug
4
ACS-3913Fall 2009 Ron McFadyen4 Contracts Contract Components (Larman) Operation - name and parameters Cross References – where (use cases) operation used Preconditions – noteworthy assumptions about the state of the system or Domain Model objects Postconditions - state of objects after the operation completes objects:any new ones? any attributes modified? associations: any new or modified associations? Larman’s version is very informal
5
ACS-3913Fall 2009 Ron McFadyen5 Contracts Example Operation:enterItem (itemID : ItemID, quantity : integer) Preconditions there is a Sale underway Postconditions a SalesLineItem instance was created an association between the sale and the sales line item was created an attribute, quantity, was modified an association between the product description and the sales line item was created
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.