Use-Case Model: Adding Detail with Operation Contracts.

Slides:



Advertisements
Similar presentations
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Advertisements

Object Design Examples with GRASP
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.
March Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns Assigning responsibilities to objects to achieve user goals Section 17.4.
Fall 2009AXS-3913 Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Oct Ron McFadyen1 Ch 17: Use Case Realizations with GRASP Patterns P. 248: “The assignment of responsibilities and design of collaborations.
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 Object Design Examples with GRASP Chapter 18 Applying UML and Patterns Craig Larman Presented By : Ajay Alegonda.
NJIT Use Case Model Operation Contracts Prepared By: Sumit Sharma.
Collaboration Diagrams. Example Building Collaboration Diagrams.
ACS-3913Fall 2009 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
Feb Ron McFadyen1 Use Case Realizations with GRASP Patterns “The assignment of responsibilities and design of collaborations are very important.
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
November Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Sept Ron McFadyen1 Extend Relationship.
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)
TK2023 Object-Oriented Software Engineering CHAPTER 6 SYSTEM SEQUENCE DIAGRAMS.
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812)
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
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
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.
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.
Design Class Diagrams (DCDs)
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
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.
System sequence diagrams
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
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.
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
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.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
1 Design Model Use-Case realizations with GRASP Larman chapter 17.
1 Object Oriented Analysis and Design System Events & Contracts.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
OO Methodology Elaboration Phase Iteration 1- Part 2.
Ch 17: Use Case Realizations with GRASP Patterns
Object Design Examples with GRASP
TK2023 Object-Oriented Software Engineering
System Sequence Diagrams and Operation Contracts
GRASP: Visibility and Design
System sequence diagrams
Chapter 11: Collaboration Diagram - PART1
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Chapter 10: Visibility Chapter 18 in Applying UML and Patterns Book.
Chapter 11: Class Diagram
Implementation Model: Mapping Designs to Code
Operation Contracts Ch. 11.
Chapter 11: Class Diagram
Design Model: Creating Design Class Diagrams
Presentation transcript:

Use-Case Model: Adding Detail with Operation Contracts

Contracts Contracts are documents that describe system behavior. 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. The entire set of system operations across all use cases, defines the public system interface.

System Operations and the System Interface

Example Contract: addLineItem Contract CO2: addLineItem Operation: addLineItem (itemID: ItemID, quantity: integer) Cross References: Use Cases: Process Sale. Pre-conditions: There is a sale underway. Post-conditions: A SalesLineItem instance sli was created. (instance creation) sli was associated with the Sale. (association formed) sli.quantity was set to quantity. (attribute modification) sli was associated with a ProductSpecification, based on itemID match (association formed)

Pre- and Postconditions Preconditions are assumptions about the state of the system before execution of the operation. A postcondition is an assumption that refers to the state of the system after completion of the operation. – The postconditions are not actions to be performed during the operation. – Describe changes in the state of the objects in the Domain Model (instances created, associations are being formed or broken, and attributes are changed)

addLineItem postconditions Instance Creation and Deletion After the itemID and quantity of an item have been entered by the cashier, what new objects should have been created? – A SalesLineItem instance sli was created.

addLineItem postconditions Attribute Modification After the itemID and quantity of an item have been entered by the cashier, what attributes of new or existing objects should have been modified? sli.quantity was set to quantity (attribute modification).

addLineItem postconditions Associations Formed and Broken After the itemID and quantity of an item have been entered by the cashier, what associations between new or existing objects should have been formed or broken? – sli was associated with the current Sale (association formed). – sli was associated with a ProductSpecification, based on itemID match (association formed).

Writing Contracts leads to Domain Model Updates It is also common to discover the need to record new concepts, attributes or associations in the Domain Model.

Guidelines for Contracts

Interaction Diagram Notation

Introduction

Example Collaboration Diagram: makePayment

How to Read the makePayment Collaboration Diagram

Illustrating Classes and Instances

Creation of Instances

Conditional Messages

Mutually Exclusive Conditional Paths

Iteration or Looping

Design Model: Determining Visibility

Visibility Between Objects

Visibility How do we determine whether one resource (such as an instance) is within the scope of another? Visibility can be achieved from object A to object B in four common ways: – Attribute visibility: B is an attribute of A. – Parameter visibility: B is a parameter of a method of A. – Local visibility: B is a (non-parameter) local object in a method of A. – Global visibility: B is in some way globally visible.

Visibility

Attribute Visibility Attribute visibility from A to B exists when B is an attribute of A. It is a relatively permanent visibility, becausenit persists as long as A and B exist. In the addLineItem collaboration diagram, Register needs to send message getSpecification message to a ProductCatalog. Thus, visibility from Register to ProductCatalog is required.

Attribute Visibility

Design Model: Creating Design Class Diagrams

Domain Model vs. Design Model Classes

Adding Navigability and Dependency Relationships