Use-Case Model : Adding Detail with operation contracts - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Use-Case Model : Adding Detail with operation contracts

Description:

Use-Case Model : Adding Detail with operation contracts Larman ch. 13 UP artifacts Operation contracts Part of the use-case model Analyze technique Use cases are the ... – PowerPoint PPT presentation

Number of Views:98
Avg rating:3.0/5.0
Slides: 14
Provided by: pou101
Category:

less

Transcript and Presenter's Notes

Title: Use-Case Model : Adding Detail with operation contracts


1
Use-Case Model Adding Detail with operation
contracts
  • Larman ch. 13

2
UP artifacts
3
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
System operations handle system events
System events invoke systems Operations. The
System event makeNewSale invokes a System
operation called makeNewSale
5
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
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
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 ?
  • Dont describe HOW it is archived.

8
Contracts leads to.
  • It is common to discover
  • new conceptual Classes
  • Attributes
  • Associations
  • Dont be limited to the prior definition of the
    Domain Model

9
Guidelines Contratcs
  • Identifying operations from the SSDs.
  • For system operations that are complex and
    perhaps subtle in their results, or which are not
    clear in the use case, constructs a contract.
  • To describe the postconditions, use the following
    categories
  • Instance creation and deletion
  • Attribute modification
  • Associations formed and broken

10
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
NextGen POS example
  • P. 185-186

12
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
Artifact relationships
Write a Comment
User Comments (0)
About PowerShow.com