Chapter 11 Operation Contracts. What They Are An operation is a specification of a transformation or query that an object may be called on to execute.

Slides:



Advertisements
Similar presentations
Object Design Examples with GRASP
Advertisements

System Sequence Diagrams
Feb 2003 R McFadyen1 Contracts (Ch 13) Used to help understand requirements more completely based on assertions; assertions are applicable to any.
Jan 23, Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Object-Oriented Analysis and Design
Jan 2005 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
NJIT Use Case Model Operation Contracts Prepared By: Sumit Sharma.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
ACS-3913Fall 2009 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
© 2005 Prentice Hall5-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
September 2002 R McFadyen1 Domain Model Use Case Model text diagram SSD System operation contracts Design Model Figure 13.3.
Object-Oriented Analysis and Design
Sept Ron McFadyen1 Extend Relationship.
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
Use Case Model Operation Contracts Prepared By: Sumit Sharma and Sravanthi Gillala.
חוזים – Contracts 1. Larman – Chapter 10 – SSDs 10.2 What are System Sequence Diagrams? (introduction) Use cases describe how external actors interact.
9/18/011 Software Requirements Analysis and Design (Continued)
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
CSSE 374: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
INFO 620Lecture #51 Information Systems Analysis and Design Sequence and Collaboration Diagrams INFO 620 Glenn Booker.
CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812)
What is a domain model? “A domain model captures the most important types of objects in the context of the business. The domain model represents the ‘things’
Chapter 18 Object Design Examples with GRASP. Objectives Design use case realizations –A use-case realization describes how a particular use case is realized.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Object-Oriented Analysis and Design Feb 4, 2009.
1 Ch 18. Object Design Examples With Grasp Objectives Design use case realizations. Apply GRASP to assign responsibilities to classes. Apply UML to illustrate.
Object Oriented Analysis and Design System Events & Contracts.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 26 GoF Design Patterns. The Adapter Design Pattern.
GRASP: Designing Objects With Responsibilities Chapter 17 Applying UML and Patterns -Craig Larman.
Object Design Examples with GRASP (Ch. 18)
Use Case Model Operation Contracts Chapter 11 Applying UML and Patterns Craig Larman.
Approaching a Problem Where do we start? How do we proceed?
Review ♦ System sequence diagram ♦ Domain model
1 Lecture 6: Operation Contracts. 2 Overview  What is contract ?  The guidelines for writing contracts for the system operations.  Use Case realizations.
Operation Contracts: Getting ready to open the “System” black box All material from Applying UML and Patterns, 3 rd Edition, Craig Larman, chapter 11.
Larman ch. 131 Use-Case Model : Adding Detail with operation contracts Larman ch. 13.
A Student Guide to Object- Oriented Development Chapter 10 Designing objects and classes.
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
System sequence diagrams
Analysis 3: Associations, Attributes, Operations, Contracts CMPT 371 Fall 2004 J.W. Benham.
Chapter 10 Drawing System Sequence Diagrams
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Operation Contracts. Primary way to describe system behavior is with use cases Operation contracts provide more details in terms of state changes to objects.
Week 4 Operational Contracts Requirements to Design Logical Architecture.
Phase 6 Start: Saturday14 April End: Saturday 21 April
Case Study in Analysis: A library information system.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
GRASP: Designing Objects With Responsibilities
OO Methodology Elaboration Phase Iteration 1- Part 3.
1 Chapter 9: Operation Contracts Chapter 13 in Applying UML and Patterns Book.
Use-Case Model: Adding Detail with Operation Contracts.
1 Design Model Use-Case realizations with GRASP Larman chapter 17.
1 Object Oriented Analysis and Design System Events & Contracts.
OO Methodology Elaboration Phase Iteration 1- Part 2.
Mapping Designs to Code. It specify how to map the design into object oriented language The UML artifacts created during the design work, the interaction.
Object Design Examples with GRASP
Elaboration popo.
Chapter 9 Domain Models.
System Sequence Diagrams and Operation Contracts
Used to help understand requirements more completely
System sequence diagrams
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Chapter 18.
Chapter 11: Class Diagram
Operation Contracts Ch. 11.
Chapter 11: Class Diagram
Design Model: Creating Design Class Diagrams
Presentation transcript:

Chapter 11 Operation Contracts

What They Are An operation is a specification of a transformation or query that an object may be called on to execute. In UML, an operation has a signature (name and parameters). A method is an implementation of an operation

What They Are They use a pre- and post-condition form to describe detailed changes to objects in a domain model as the result of an operation They’re part of the use case model They’re too detailed to be part of inception; if you write them, do so during elaboration

Postconditions Describe changes in the state of objects in the domain model. Changes include instances created, associations formed or broken, and attributes changed They are not actions to be performed during the operation. They are results, observations about the objects after the operation Deletion breaks an association

Why Postconditions? They aren’t always necessary. Usually the effects of the operations are clear Support fine detail in defining the outcome of an operation Could do it in use cases, but would make them too bulky

How to Write Express in the past tense; they are observations about state changes from the operation, not an action “A SalesLineItem was created” vs. Create a SalesLineItem One way I do this is to start with the phrase: “After the operation, the following things will be true: “ This avoids past tense and passive voice.

How Complete? Complete set not necessary Use only when they add clarity

Example: EnterItem Postconditions A SalesLineItem instance sli was created Sli.quantity became quantity Sli was associated with the current Sale Sli was associated with a ProductDescription based on itemID match Update your domain model as needed

When are they Useful? When the level of detail would make the use case awkward or too detailed When the number of things that must be true at the end of an operation is large

How to Write Identify the operations from System Sequence Diagrams For operations that are complex and perhaps not clear in the use case, construct a contract Categories: – Instance creation and deletion – Attribute modification – Associations formed and broken