DOC PREVIEW
UT Dallas CS 6359 - S13_Chapters_11_32

This preview shows page 1-2-15-16-31-32 out of 32 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 32 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1What will we learn?Operation ContractsSlide 4Operation ContractsOperations Contracts - SectionsSystem OperationsSlide 8Operation Contracts: PostconditionsOperation Contracts: PostconditionsExample: enterItem PostconditionsSlide 12Slide 13Slide 14Operation ContractsenterItem Postcondition: Putting it TogetherenterItem Postcondition: Putting it TogetherReviewHow to Create Operations ContractsSlide 20NextGen POS Operation ContractsNextGen POS Operation ContractsNextGen POS Operation ContractsNextGen POS Operation ContractsNextGen POS: Expanding the SSDsSlide 26Slide 27Slide 28Slide 29NextGen POS Operation ContractsNextGen POS Operation ContractsTakeaways from Chapter 11, 32Object-Oriented Analysis and DesignCHAPTER 11, 32: OPERATION CONTRACTS & SYSTEM SEQUENCE DIAGRAMS1What will we learn?Operation Contracts – how to define the system operations, and how to create contracts for themDefine SSDs and Operation Contracts for the example case studies2Operation Contracts Often, the use cases and SSDs are enough to describe the system Sometimes, more detail of the system behavior is required, and that is where Operation Contracts are used The Use-Case Model and Domain Model are the main OOA artifacts, but Operation Contracts and State Models are also helpfulRemember the SSDs are part of the Use-Case Model artifact Actually, the Operation Contracts are considered part of the Use-Case Model, since they usually expand upon the SSD34Operation: enterItem(…)Post-conditions:- . . .Operation ContractsSaledate. . .SalesLineItemquantity1..*1. . .. . .Domain ModelUse-Case ModelDesign Model: RegisterenterItem(itemID, quantity): ProductCatalogspec = getProductSpec( itemID )addLineItem( spec, quantity ): SaleRequire-mentsBusiness ModelingDesignSample UP Artifact Relationships: SystementerItem(id, quantity)Use Case TextSystem Sequence DiagramsmakeNewSale()system eventsCashierProcess Sale: Cashieruse case namessystem operationsUse Case DiagramVisionSupplementarySpecificationGlossarystarting events to design for, and more detailed requirements that must be satisfied by the softwareProcess Sale1. Customer arrives ...2. ...3. Cashier enters item identifier.the domain objects, attributes, and associations that undergo changesrequirements that must be satisfied by the softwareideas for the post-conditionsOperation Contracts Operation Contracts describe pre- and post-condition changes to the objects in the Domain Model as a result of a system operation. They are text based documentation. Before looking at them in detail, let’s consider an example (terms like (instance creation) are added for explanation in this example, and would not be part of the actual contract): Contract CO2: enterItem Operation: enterItem(itemID: itemID, quantity: integer)Cross Reference: Use Cases: Process SalesPreconditions: There is a sale underwayPostconditions: -A SalesLineItem instance sli was created (instance creation)-sli was associated with the current Sale (association formed)-sli.quantity became quantity (attribute modification)-sli was associated with a ProductDescription, based on itemID match(association formed)5Operations Contracts - Sections The sections of an Operations Contract are: Operation: Name of the operation, and parameters Cross References: Use cases this operation can occur within Preconditions: Noteworthy assumptions about the state of the system or objects in the Domain Model before execution of the operation. These arenon-trivial assumptions the reader should be aware of. Postconditions: The most important section. The state of objects in the Domain Model after the completion of the operation. 6System Operations System operations can be thought of as operations the system (as a black-box) offers to its users They are identified when the SSDs are created The SSDs show system events which usually trigger system operations Some of the system events are input events (see next slide) The entire set of system operations, across all use cases, defines a public interface which views the system as one single component or class.78: CashierenterItem(itemID, quantity)endSale()makePayment(amount)description, totaltotal with taxeschange due, receiptmakeNewSale()these input system events invoke system operationsthe system event enterItem invokes a system operationcalled enterItem and so forththis is the same as in object-oriented programming when we say the message foo invokes the method (handling operation) foo[ more items ]loop:SystemProcess Sale ScenarioOperation Contracts: Postconditions The postcondition describes changes in the state of objects in the Domain Model. Such changes include instance creation, associations formed or broken, and attributes changed. Note that postconditions are not actions to be performed during the operation! Postconditions describe the changes to the object, they do not explain how the changes are done Breaking an association is rare, but can happen (cancel sale, for example) Instance deletion is also rare; remember, we are still in the Domain Model, not the actual software classes, so freeing up memory is not an issue9Operation Contracts: Postconditions The instances and associations that are created by an Operation Contract appear in the Domain Model – the contract should capture the behavior expressed in the Use Case Model as it relates to the objects and associations in the Domain Model Note that postconditions (and in fact Operation Contracts) are optional – not every operation needs a contract, and often the postconditions are obvious and do not need to be documented This is another tool to help understand the system behavior Again, this is an analysis tool – it will help define what changes, not how it changes Usually postconditions are written in the past tense – A SalesLineItem was created, not is created10Example: enterItem Postconditions Look at the types of changes identified in the enterItem postcondition First, recall the Main Scenario of the Process Sale use case (pg 69 of the book): Main Success Scenario:…3. Cashier enters item identifier4. System records sale line item and presents item description, price, and running total. Price calculated from a set of price rules.… Also, recall the Domain Model and SSD for this example (next slides):1112SalesCashierCustomer1..*SalesLineItem/quantitySaledateisCompletetimeInitiates Core::RegisterRecords-sales-onCaptured-onCore::Store


View Full Document

UT Dallas CS 6359 - S13_Chapters_11_32

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture4

Lecture4

48 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download S13_Chapters_11_32
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view S13_Chapters_11_32 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view S13_Chapters_11_32 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?