Download presentation
Presentation is loading. Please wait.
Published byGyles Higgins Modified over 9 years ago
1
Larman ch. 131 Use-Case Model : Adding Detail with operation contracts Larman ch. 13
2
2 UP artifacts
3
Larman ch. 133 Operation contracts Part of the use-case model –Analyze technique Use cases are the primary mechanism in UP to describe system behavior Contracts help define system behavior –Adds more details –Contracts may not be needed. Objectives –Define operation contracts with Post conditions –Relate contracts to the Domain Model and the Use- Case Model.
4
Larman ch. 134 System operations handle system events System events invoke systems Operations. The System event makeNewSale invokes a System operation called makeNewSale
5
Larman ch. 135 Contracts CO2 : enterItem Operation : –Name of operation and parameters –enterIOtem(itemID: ItemID, quantity : integer) Cross Refernce : –Optional use case this operation can occur within –Use Cases : Process Sale Preconditions : –Assumptions about the state of the system before execution of the operation –There is a sale underway Postconditions : –The state of the objects in the domain model after completion of the operation –A SalesItem instanse 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 ProductsSpecification, based on itemID match (association formed)
6
Larman ch. 136 Postconditions Describe changes in the state of objects in the domain model that are true when the operation has finished. They are not actions to be performed during the operation Postconditions fall into these categories : –Instance creation and deletion –Attribute modification –Associations (UML links) formed and broken.
7
Larman ch. 137 WHAT !!! Focus on WHAT must happen in terms of objects in the Domain Model. –What instances can be created ? –What associations can be formed ? –What attribute can be modified ? Don’t describe HOW it is archived.
8
Larman ch. 138 Contracts leads to…. It is common to discover –new conceptual Classes –Attributes –Associations Don’t be limited to the prior definition of the Domain Model
9
Larman ch. 139 Guidelines : Contratcs 1.Identifying operations from the SSDs. 2.For system operations that are complex and perhaps subtle in their results, or which are not clear in the use case, constructs a contract. 3.To describe the postconditions, use the following categories : Instance creation and deletion Attribute modification Associations formed and broken
10
Larman ch. 1310 Postconditions : past tense Notice that the statements are expressed in the past tense : –A SalesLineItem sli was created (instance operation) –Sli was associated with the current Sale (association formed)
11
Larman ch. 1311 NextGen POS example P. 185-186
12
Larman ch. 1312 UML operations UML operation : –An operation is a specification of a transformation or query that an object may be called to execute A method is an implementation of an operation. An UML operation has a : –Signature –Operation specification ( describes the effects produced by executing the operation (that is the postconditions. –Uses Pre- and Postconditions
13
Larman ch. 1313 Artifact relationships
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.