SlideShare a Scribd company logo
4
Most read
8
Most read
Use Case Model
Operation Contracts
Objective
2
 Create contracts for system operations.
Unified Process Artifacts
Business Model
Requirements
Design
Domain Model
Use Case Model
Operation Contract
Use Case Text
System Sequence
Diagrams
Interaction Diagrams
Supplementary
Specifications
Vision
Glossary
See Figure 11.1 in text book for more detail
Why Contracts
Use cases are the primary mechanism in
the UP to describe system behavior, and
are usually sufficient.
However, sometimes a more detailed
description of system behavior has value.
Contracts for operations can help define
system behavior.
4
Domain Model And Contracts
A Domain Model is a visual
representation of conceptual classes or
real-world objects in a domain of interest.
Contracts describe detailed system
behavior in terms of state changes to
objects in the Domain Model, after a
system operation has executed.
5
Keep it Agile
In many, or even most software
development projects, operation contracts
may be unnecessary. For an agile
process, use them only when necessary to
add additional detail and understanding.
6
System Operations and
the System Interface
Contracts may be defined for system
operations – operations that the system as a
black box offers in its public interface to handle
incoming system events. System operations can
be identified by discovering these system
events.
The entire set of system operations, across all
use cases, defines the public system interface,
viewing the system as a single component or
class.
7
Example Contract:
enterItem
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 (instance creation)
-sli was associated with the
current Sale (association formed)
-sli.quantity became quantity
(attribute modification)
-sli was associated with a
ProductSpecification, based on
itemID match (association formed)
8
Contract CO2: enterItem
Contract Sections
Operation: Name Of operation, and parameters.
Cross References: (optional) Use cases this
can occur within.
Preconditions: Noteworthy assumptions about the
state of the system or objects in
the Domain Model before execution
of the operation.
Postconditions: -The state of objects in the
Domain Model after completion of
the operation.
9
Postconditions
The postconditions describe changes in the
state of objects in the Domain Model. Domain
Model state changes include instances created,
associations formed or broken, and attributes
changed.
Postconditions are not actions to be performed,
during the operation; rather, they are
declarations about the Domain Model objects
that are true when the operation has finished.
10
The Spirit of Postconditions: The
Stage and Curtain
Express postconditions in the past tense,
to emphasize they are declarations about
a state change in the past.
(better) A SalesLineItem was created.
(worse) Create a SalesLineItem.
11
The Spirit of Postconditions: The
Stage and Curtain
Think about postconditions using the following image:
The system and it’s objects are presented on a theatre
stage.
Before the operation, take a picture of the stage.
Close the curtains on the stage, and apply the
system operation
Open the curtains and take a second picture.
Compare the before and after pictures, and
express as postconditions the changes in the
state of the stage (A SalesLineItem was
created…).
12
Writing Contracts Leads to
Domain Model Updates
New conceptual classes, attributes, or
associations in the Domain Model are
often discovered during contract writing.
Enhance the Domain Model as you make
new discoveries while thinking through the
operation contracts.
13
Contracts vs. Use Cases
The use cases are the main repository of
requirements for the project. They may
provide most or all of the detail necessary
to know what to do in the design.
If the details and complexity of required
state changes are awkward to capture in
use cases, then write operation contracts.
14
Contracts vs. Use Cases contd…
If developers can understand what to do based on the
use cases and ongoing (verbal) collaboration with a
subject matter expert, avoid writing contracts.
Operation contracts are uncommon. If a team is making
contracts for every system operation:
the use cases are poorly done, or
there is not enough collaboration or access to a
subject matter expert, or
the team is doing too much unnecessary
documentation.
15
Guidelines: Contracts
To make contracts:
Identify system operations from the SSDs.
For system operations that are complex and
perhaps subtle in their own results, or which are
not clear in the use case, construct a contract.
To describe the postconditions, use:
- instance creation and deletion
- attribute modification
- associations formed and broken
16
Operation Contracts
Within the UP
Phases
Inception – Contracts are not needed
during inception – they are too detailed.
Elaboration – If used at all, most contracts
will be written during elaboration, when
most use cases are written. Only write
contracts for the most complex and subtle
system operations.
17

More Related Content

PPTX
Query processing and optimization (updated)
PDF
Software Engineering :UML class diagrams
PPTX
Decomposition methods in DBMS
PPTX
database recovery techniques
PDF
CS6401 OPERATING SYSTEMS Unit 3
PDF
SE_Lec 05_System Modelling and Context Model
PPT
Object oriented modeling and design
PPT
2.Problems Problem Spaces and Search.ppt
Query processing and optimization (updated)
Software Engineering :UML class diagrams
Decomposition methods in DBMS
database recovery techniques
CS6401 OPERATING SYSTEMS Unit 3
SE_Lec 05_System Modelling and Context Model
Object oriented modeling and design
2.Problems Problem Spaces and Search.ppt

What's hot (20)

PPT
Transactions in dbms
PPTX
Database Design and Normalization Techniques
PPTX
8 queens problem using back tracking
PPTX
Lecture 1 ddbms
DOCX
Ooad notes
PPT
Chapter 7 - Deadlocks
PPTX
Normalization in DBMS
PPTX
Class Diagram
PPT
08. Object Oriented Database in DBMS
PPTX
Distributed database management system
PPT
Disk scheduling algorithms
PPTX
AI_Session 10 Local search in continious space.pptx
PPTX
A Role of Lexical Analyzer
PPT
Object Oriented Modeling and Design with UML
PPT
Virtual memory
PDF
Types of UML diagrams
PPTX
Previous question papers of Database Management System (DBMS) By SHABEEB
PPTX
Purpose of DBMS and users of DBMS
PDF
I. Hill climbing algorithm II. Steepest hill climbing algorithm
PDF
CS8592-OOAD Lecture Notes Unit-3
Transactions in dbms
Database Design and Normalization Techniques
8 queens problem using back tracking
Lecture 1 ddbms
Ooad notes
Chapter 7 - Deadlocks
Normalization in DBMS
Class Diagram
08. Object Oriented Database in DBMS
Distributed database management system
Disk scheduling algorithms
AI_Session 10 Local search in continious space.pptx
A Role of Lexical Analyzer
Object Oriented Modeling and Design with UML
Virtual memory
Types of UML diagrams
Previous question papers of Database Management System (DBMS) By SHABEEB
Purpose of DBMS and users of DBMS
I. Hill climbing algorithm II. Steepest hill climbing algorithm
CS8592-OOAD Lecture Notes Unit-3
Ad

Similar to Lecture10 use case model operation contracts (20)

PPTX
Lecture-System_Contracts.pptx
PPT
Ooa 2 Post1
PPT
8. operation contracts
PPT
Contract First Modeling Services Using Uml
PPTX
OODM through UML [Chapter 2] according to PU.pptx
PPT
chapter-4-objected-oriented analysis and design with UML.ppt
PPTX
Rock Your Code with Code Contracts
PDF
Ooad 2marks
DOCX
12 bước phân tích hệ thống thông tin.
PDF
Software development contractual issues susan atkinson
PPT
Object oriented analysis and design. SE 221
PPTX
Rock Your Code With Code Contracts -2013
PPTX
SAD06 - Use Case Diagrams
PPTX
OOAD U1.pptx
PPTX
lec 15.pptxlec 15.pptxlec 15.pptxlec 15.pptxlec 15.pptx
PPT
Software System Engineering - Chapter 13
PPTX
Code contracts by Dmytro Mindra
PPTX
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
PPTX
Enhance Your Code Quality with Code Contracts
Lecture-System_Contracts.pptx
Ooa 2 Post1
8. operation contracts
Contract First Modeling Services Using Uml
OODM through UML [Chapter 2] according to PU.pptx
chapter-4-objected-oriented analysis and design with UML.ppt
Rock Your Code with Code Contracts
Ooad 2marks
12 bước phân tích hệ thống thông tin.
Software development contractual issues susan atkinson
Object oriented analysis and design. SE 221
Rock Your Code With Code Contracts -2013
SAD06 - Use Case Diagrams
OOAD U1.pptx
lec 15.pptxlec 15.pptxlec 15.pptxlec 15.pptxlec 15.pptx
Software System Engineering - Chapter 13
Code contracts by Dmytro Mindra
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
Enhance Your Code Quality with Code Contracts
Ad

More from Shahid Riaz (20)

PPTX
Shimla deputation (1906)
PPTX
#Syed ahmad shaheed barailvi
PDF
How to program in c++ with 100 examples
PDF
Virtual private networks in theory and practice
PPT
Database systems administration week 1
PPTX
Database systems administration traning 02
PPTX
Database systems administration traning 02
PPTX
Database systems administration traning 01
PPTX
Database systems administration traning 0
PPTX
Database systems administration traning 04
PPTX
Managing people and organizing team
PPTX
Lec 1 intro to internet
PPT
Course guidlines course book it 3548
PPT
Lecture12 software design class diagram
PPT
Lecture11 use case sequence diagram
PDF
Lecture9 domain model visualizing
PDF
Lecture8 system sequence
PDF
Lecture7 use case modeling
PDF
Lecture6 activity diagrams
PPTX
Lecture 5 defining the system
Shimla deputation (1906)
#Syed ahmad shaheed barailvi
How to program in c++ with 100 examples
Virtual private networks in theory and practice
Database systems administration week 1
Database systems administration traning 02
Database systems administration traning 02
Database systems administration traning 01
Database systems administration traning 0
Database systems administration traning 04
Managing people and organizing team
Lec 1 intro to internet
Course guidlines course book it 3548
Lecture12 software design class diagram
Lecture11 use case sequence diagram
Lecture9 domain model visualizing
Lecture8 system sequence
Lecture7 use case modeling
Lecture6 activity diagrams
Lecture 5 defining the system

Recently uploaded (20)

PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
history of c programming in notes for students .pptx
PPTX
Introduction to Artificial Intelligence
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
Digital Strategies for Manufacturing Companies
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PTS Company Brochure 2025 (1).pdf.......
history of c programming in notes for students .pptx
Introduction to Artificial Intelligence
Softaken Excel to vCard Converter Software.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Design an Analysis of Algorithms II-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Design an Analysis of Algorithms I-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How to Migrate SBCGlobal Email to Yahoo Easily
2025 Textile ERP Trends: SAP, Odoo & Oracle
Wondershare Filmora 15 Crack With Activation Key [2025
How Creative Agencies Leverage Project Management Software.pdf

Lecture10 use case model operation contracts

  • 2. Objective 2  Create contracts for system operations.
  • 3. Unified Process Artifacts Business Model Requirements Design Domain Model Use Case Model Operation Contract Use Case Text System Sequence Diagrams Interaction Diagrams Supplementary Specifications Vision Glossary See Figure 11.1 in text book for more detail
  • 4. Why Contracts Use cases are the primary mechanism in the UP to describe system behavior, and are usually sufficient. However, sometimes a more detailed description of system behavior has value. Contracts for operations can help define system behavior. 4
  • 5. Domain Model And Contracts A Domain Model is a visual representation of conceptual classes or real-world objects in a domain of interest. Contracts describe detailed system behavior in terms of state changes to objects in the Domain Model, after a system operation has executed. 5
  • 6. Keep it Agile In many, or even most software development projects, operation contracts may be unnecessary. For an agile process, use them only when necessary to add additional detail and understanding. 6
  • 7. System Operations and the System Interface Contracts may be defined for system operations – operations that the system as a black box offers in its public interface to handle incoming system events. System operations can be identified by discovering these system events. The entire set of system operations, across all use cases, defines the public system interface, viewing the system as a single component or class. 7
  • 8. Example Contract: enterItem 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 (instance creation) -sli was associated with the current Sale (association formed) -sli.quantity became quantity (attribute modification) -sli was associated with a ProductSpecification, based on itemID match (association formed) 8 Contract CO2: enterItem
  • 9. Contract Sections Operation: Name Of operation, and parameters. Cross References: (optional) Use cases this can occur within. Preconditions: Noteworthy assumptions about the state of the system or objects in the Domain Model before execution of the operation. Postconditions: -The state of objects in the Domain Model after completion of the operation. 9
  • 10. Postconditions The postconditions describe changes in the state of objects in the Domain Model. Domain Model state changes include instances created, associations formed or broken, and attributes changed. Postconditions are not actions to be performed, during the operation; rather, they are declarations about the Domain Model objects that are true when the operation has finished. 10
  • 11. The Spirit of Postconditions: The Stage and Curtain Express postconditions in the past tense, to emphasize they are declarations about a state change in the past. (better) A SalesLineItem was created. (worse) Create a SalesLineItem. 11
  • 12. The Spirit of Postconditions: The Stage and Curtain Think about postconditions using the following image: The system and it’s objects are presented on a theatre stage. Before the operation, take a picture of the stage. Close the curtains on the stage, and apply the system operation Open the curtains and take a second picture. Compare the before and after pictures, and express as postconditions the changes in the state of the stage (A SalesLineItem was created…). 12
  • 13. Writing Contracts Leads to Domain Model Updates New conceptual classes, attributes, or associations in the Domain Model are often discovered during contract writing. Enhance the Domain Model as you make new discoveries while thinking through the operation contracts. 13
  • 14. Contracts vs. Use Cases The use cases are the main repository of requirements for the project. They may provide most or all of the detail necessary to know what to do in the design. If the details and complexity of required state changes are awkward to capture in use cases, then write operation contracts. 14
  • 15. Contracts vs. Use Cases contd… If developers can understand what to do based on the use cases and ongoing (verbal) collaboration with a subject matter expert, avoid writing contracts. Operation contracts are uncommon. If a team is making contracts for every system operation: the use cases are poorly done, or there is not enough collaboration or access to a subject matter expert, or the team is doing too much unnecessary documentation. 15
  • 16. Guidelines: Contracts To make contracts: Identify system operations from the SSDs. For system operations that are complex and perhaps subtle in their own results, or which are not clear in the use case, construct a contract. To describe the postconditions, use: - instance creation and deletion - attribute modification - associations formed and broken 16
  • 17. Operation Contracts Within the UP Phases Inception – Contracts are not needed during inception – they are too detailed. Elaboration – If used at all, most contracts will be written during elaboration, when most use cases are written. Only write contracts for the most complex and subtle system operations. 17