1 Object Oriented Analysis and Design System Events & Contracts.

Slides:



Advertisements
Similar presentations
Object Design Examples with GRASP
Advertisements

System Sequence Diagrams
Use cases.
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
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.
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
Jan Ron McFadyen1 Consider a simple cash-only Process Sale scenario 1. Customer arrives at a POS checkout with goods and/or services to purchase.
Object-Oriented Analysis and Design
Drawing System Sequence Diagrams
Jan 2005 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Solving the Problem Analysis & Design.
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;
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
Object-Oriented Analysis and Design
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)
LECTURE 5 SEQUENCE DIAGRAM 1. INTRODUCTION – SYSTEM SEQUENCE DIAGRAM A system sequence diagram is a fast and easily created artifact that illustrates.
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.
INFO 620Lecture #51 Information Systems Analysis and Design Sequence and Collaboration Diagrams INFO 620 Glenn Booker.
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’
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
1 Unified Modelling Language OOA/OOD a summary of the book: Applying UML and Patterns, Craig Larman D. Dranidis October 2000 CITY College.
Object Oriented Analysis and Design System Events & Contracts.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Object Design Examples with GRASP (Ch. 18)
Sept Ron McFadyen1 Section 10.1 Domain Models Domain Model: a visual representation of conceptual classes or real-world objects in a domain.
Use Case Model Operation Contracts Chapter 11 Applying UML and Patterns Craig Larman.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 20. Review Software Requirements Requirements Engineering Process.
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.
Chapter 9 Applying UML and Patterns -Craig Larman
♦ Use Case Model  Detailled use case - Important  Use case diagram- Refactoring Use case diagram  > 1 Last Lectures.
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.
Drawing System Sequence Diagrams
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
Business Analysis with For PG MDI, Gurgaon Kamna Malik, Ph.D.
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.
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
PRESENTATION ON USE CASE. Use Case Modeling Use case diagrams describe what a system does from the standpoint of an external observer. The emphasis is.
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
Understanding Requirements
OO Methodology Elaboration Phase Iteration 1- Part 3.
Summary from previous lectures
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.
SYSTEM-LEVEL SEQUENCE DIAGRAMS Sys466. System-Level Sequence Diagrams  Use cases describe how external actors interact with the software system…  An.
OO Methodology Elaboration Phase Iteration 1- Part 2.
System Sequence Diagrams and Operation Contracts
Webapp Design with System Sequence Diagrams
UML Use Case Diagrams.
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
Sequence Diagrams.
Sequence Diagrams Lecture 6.
Object Oriented Analysis and Design Conceptual Model.
System Sequence Diagrams(SSD)
Operation Contracts Ch. 11.
Domain Model: Visualizing Concepts
Design Model: Creating Design Class Diagrams
Presentation transcript:

1 Object Oriented Analysis and Design System Events & Contracts

2 Object Oriented Analysis and Design Analysis Design Use Cases What are the domain process ? (text + visual notation) Software Requirements Specification What are the business needs ? (long text) Conceptual Model What are the concepts, terms ? (visual) System Sequence Diagrams What are the system events, operations ? (visual) Contracts What do the system operations do ? (text) Collaboration / sequence Diagrams How software objects interact to fulfill task ? (visual) Design Class Diagrams What is the specification for the software classes ? (visual)

3 System Sequence Diagrams Cashier :System enterItem(UPC,quantity) endSale() makePayment(amount) Corresponds to: Buy Item Use Case Repeat until no more items

4 System Sequence Diagrams Cashier :System enterItem(UPC,quantity) endSale() makePayment(amount) Actor Actions: 1.This use case begins when a Customer arrives at a POST checkout system with items to purchase 2. Cashier records the identifier for each item. If there is more than one of the same item, Cashier enters the quantity 4. On completion of item entry, Cashier indicates to POST that item entry is complete 6. Cashier tells Customer the total System Response: 3. Determines item price and adds item info to the running sales transaction Description and price of the current item is presented 5. Calculates and presents sale total

5 System Sequence Diagrams elements Cashier :System enterItem(UPC,quantity) endSale() makePayment(amount) Corresponds to: Buy Item Use Case Repeat until no more items Actor Cross reference to use case Text to clarify logic, control, iterations, etc.. System event System BLACK BOX

6 System Sequence Diagrams elements

7 System Sequence Diagrams Identifying system events It is necessary to be clear about the system boundary Actors to be considered are those who trigger the system Costumer is not an actor ! From use case typical course of events, identify system (external) events

8 System Sequence Diagrams Naming System Events Express at the level of intent rather than in terms of physical input medium Preferably, start the name with a verb endSale()ESCPressed() makePayment(amount)enterAmountTendered(amount) enterPayment(amount) Better Worse

9 Object Oriented Analysis and Design Analysis Design Use Cases What are the domain process ? (text + visual notation) Software Requirements Specification What are the business needs ? (long text) Conceptual Model What are the concepts, terms ? (visual) System Sequence Diagrams What are the system events, operations ? (visual) Contracts What do the system operations do ? (text) Collaboration / sequence Diagrams How software objects interact to fulfill task ? (visual) Design Class Diagrams What is the specification for the software classes ? (visual)

10 Contracts Describes what an operation commits to achieve What will happen rather than how it will be achieved Depends on conceptual model system sequence diagrams identification of system operations

11 Contracts example: enterItem Name: enterItem(upc:number, quantity:integer) Responsibility: Enter (record) sale of an item and add it to sale. Display item description and price. Type: System Cross References: System Functions: R1.1, R1.3, R1.9. Use Cases: Buy Items Notes: Use fast dbase access Exceptions: If UPC is invalid, indicate an error Pre-Conditions: UPC is known to system

12 Contracts example: enterItem Post-Conditions: If new sale, a Sale was created (instance creation) If new sale, new Sale was associated with POST (association formed) A SalesLineItem was created (instance created) SalesLineItem was associated with Sale (association formed) SaleLineItem.quantity was set to quantity (attribute modification) SaleLineItem was associated with ProductSpecification based on UPC match (association formed)

13 Contracts Contract Sections Name: Name of operation, and parameters Responsibilities: An informal description of responsibilities this operation must fulfill Type: Name of type (concept, software class, interface) Cross References: System function reference numbers, use cases, etc. Notes: Design notes, algorithms, etc. Exceptions: Exceptional cases

14 Contracts Contract Sections Output: Non-UI outputs such as messages or records that are sent outside of system Pre-Conditions: Assumptions about the state of system before execution of operation Post-Conditions: The state of system after completion of operation

15 Contracts How to make Contracts Identify system operations from system sequence diagrams For each system operation, construct a contract Start by writing responsibilities section Then complete post conditions section Then move to pre-conditions section

16 Contracts How to make Contracts Writing post conditions It should describe the state changes that occur to objects in the conceptual model (rather than actions) Possible state changes: Instance creation or deletion Attribute modification Association formed or broken

17 Contracts How to make Contracts Writing post conditions Use past passive tense form (was..) Establish memory between existing objects: The most common mistake: not forming associations Association to several objects is very likely Think of the system and its object like a stage in a theatre Craig Larman

18 Contracts More on Contracts Generating complete and accurate set of post- conditions is not likely and not necessary Following pre-conditions worth capturing: Things that are important to test in software Things that affect the success of operation Use notes section to capture known design statements Use exceptions section to discuss reaction to exceptional situations

19 From Use Cases to Contracts Use Case: Buy Item … Typical Course of Events: 1.… Use Case Cashier System enterItem endSale makePayment System Sequence Diagram System enterItem() endSale() makePayment() System Operations Contracts Operation: enterItem … Post-conditions: 1. … Operation: endSale … Post-conditions: 1. …

20 Contracts More example (from larman’s book)

21

22

23

24 Contracts More example login use case  contract

25 Use Case Description

26

27

28 Object Oriented Analysis and Design Analysis Design Use Cases What are the domain process ? (text + visual notation) Software Requirements Specification What are the business needs ? (long text) Conceptual Model What are the concepts, terms ? (visual) System Sequence Diagrams What are the system events, operations ? (visual) Contracts What do the system operations do ? (text) Collaboration / sequence Diagrams How software objects interact to fulfill task ? (visual) Design Class Diagrams What is the specification for the software classes ? (visual)