חוזים – Contracts 1. Larman – Chapter 10 – SSDs 10.2 What are System Sequence Diagrams? (introduction) Use cases describe how external actors interact.

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.
Object-Oriented Analysis and Design
Drawing System Sequence Diagrams
Systems Analysis and Design in a Changing World, Fourth Edition
Jan 2005 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
Chapter 10 System Sequence Diagrams. What is a System Sequence Diagram? A way of modeling input and output events related to systems It is a picture that.
NJIT Use Case Model Operation Contracts Prepared By: Sumit Sharma.
6/8/991 Analysis Tuesday 09/14/99 Revised: September 11, 2000 (APM)
September 2002 R McFadyen1 Domain Model Use Case Model text diagram SSD System operation contracts Design Model Figure 13.3.
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
Sept Ron McFadyen1 Extend Relationship.
Use Case Model Operation Contracts Prepared By: Sumit Sharma and Sravanthi Gillala.
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.
Chapter 7: The Object-Oriented Approach to Requirements
System Sequence Diagrams
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Object Oriented Analysis and Design System Events & Contracts.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Chapter 6 Use Cases. Use Cases: –Text stories Some “actor” using system to achieve a goal –Used to discover and record requirements –Serve as input to.
Use Case Model Operation Contracts Chapter 11 Applying UML and Patterns Craig Larman.
Review ♦ System sequence diagram ♦ Domain model
Group 2 work What is sequence diagram ? What is sequence diagram ? Why do we use it ? Why do we use it ? What is basic notation of SD? What is basic notation.
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.
PRJ566 System Sequence Diagrams.  A system sequence diagram …. Illustrates input and output events related to the system under discussion.  Larman,
♦ Use Case Model  Detailled use case - Important  Use case diagram- Refactoring Use case diagram  > 1 Last Lectures.
What to remember from Chap 13 (Logical architecture)
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Chapter 1 Applying UML and Patterns. The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary.
Larman ch. 131 Use-Case Model : Adding Detail with operation contracts Larman ch. 13.
Object-Oriented Analysis and Design CHAPTER 10: SYSTEM SEQUENCE DIAGRAMS 1.
Drawing System Sequence Diagrams
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
System sequence diagram M Taimoor Khan
System sequence diagrams
Chapter 10 Drawing 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.
TK2023 Object-Oriented Software Engineering CHAPTER 12 Introduction to Responsibility-Driven Design.
Phase 6 Start: Saturday14 April End: Saturday 21 April
Systems Analysis and Design in a Changing World, Fourth Edition
Domain Model A representation of real-world conceptual classes in a problem domain. The core of object-oriented analysis They are NOT software objects.
Summary from previous lectures
1 Chapter 9: Operation Contracts Chapter 13 in Applying UML and Patterns Book.
Software Engineering 1 Object-oriented Analysis and Design Chap 31 More SSDs and Contracts.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Use-Case Model: Adding Detail with Operation Contracts.
SYSTEM-LEVEL SEQUENCE DIAGRAMS Sys466. System-Level Sequence Diagrams  Use cases describe how external actors interact with the software system…  An.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
Object Oriented Analysis & Design By Rashid Mahmood.
1 Object Oriented Analysis and Design System Events & Contracts.
OO Methodology Elaboration Phase Iteration 1- Part 2.
Systems Analysis and Design in a Changing World, Fourth Edition
System Sequence Diagrams and Operation Contracts
Used to help understand requirements more completely
System sequence diagrams
BTS430 Systems Analysis and Design using UML
OO Domain Modeling With UML Class Diagrams and CRC Cards
How do we convince people that in programming simplicity and clarity —in short: what mathematicians call "elegance"— are not a dispensable luxury, but.
Sequence Diagrams Lecture 6.
System Sequence Diagrams(SSD)
Operation Contracts Ch. 11.
Presentation transcript:

חוזים – Contracts 1

Larman – Chapter 10 – SSDs 10.2 What are System Sequence Diagrams? (introduction) Use cases describe how external actors interact with the software system we are interested in creating. During this interaction an actor generates system events to a system, usually requesting some system operation to handle the event. For example, when a cashier enters an item's ID, the cashier is requesting the POS system to record that item's sale (the enterItem event). That event initiates an operation upon the system. The use case text implies the enterItem event, and the SSD makes it concrete and explicit. 2

10.2 What are System Sequence Diagrams? (cont.) The UML includes sequence diagrams as a notation that can illustrate actor interactions and the operations initiated by them. A system sequence diagram is a picture that shows, for one particular scenario of a use case, the events that external actors generate, their order, and inter-system events. All systems are treated as a black box; the emphasis of the diagram is events that cross the system boundary from actors to systems. Guideline Draw an SSD for a main success scenario of each use case, and frequent or complex alternative scenarios. 3

Larman – Chapter 11 – Operation Contracts (p. 181) Operation contracts may be considered part of the UP Use-Case Model because they provide more analysis detail on the effect of the system operations implied in the use case. The prime inputs to the contracts are the system operations identified in SSDs, the domain model, and domain insight from experts. The contracts can in turn serve as input to the object design, as they describe changes that are likely required in the software objects or database. 4

11.2 What are the sections of a contract? Operation: Name of operation, and parameters. Cross References: Use cases this operation can occur within. Preconditions: Noteworthy assumptions about the state of the system or objects in the Domain Model before execution of the operation. These are non- trivial assumptions the reader should be told. Postconditions: This is the most important section. The state of objects in the Domain Model after completion of the operation. Discussed in detail in a following section. 5

11.3 Definition: What is a System Operation? Operation contracts may be defined for system operations – operations that the system as a black box component offers in its public interfaces. System operations can be identified while sketching SSDs. To be more precise, the SSDs show system events – events or I/O messages relative to the system. Input system events imply the system has system operations to handle the events, just as on OO message (a kind of event or signal) is handled by an OO method (a kind of operation). The entire set of system operations, across all use cases, defines the public system interface, viewing the system as a single component or class. In the UML, the system as a whole can be represented as one object of a class named (for example) System. 6

11.4 Definition: 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 observations about the domain model objects that are true when the operation has finished – after the smoke has cleared. To summarize, the postconditions fall into these categories: Instance creation and deletion. Attribute change of value. Associations (to be precise, UML links) formed and broken. 7

Analogy: The Spirit of Postconditions: The Stage and Curtain Why write postconditions in the past tense? Think about them using the following image: The system and its objects are presented on a stage theatre. Before the operation, take a picture of the stage. Close the curtains on the stage, and apply the system operation (background noise of clanging, screams, and screeches…). Open the curtains and take a second look. Compare the before and after pictures, and express as postconditions the changes in the state of the stage. (An item was created…). 8

11.8 Guideline: How to Create and Write Contracts Apply the following advice to create contracts: Identify system 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, construct a contract. To describe the postconditions, use the following categories: Instance creation and deletion Attribute modification Associations formed and broken What's the Most Common Mistake? The most common problem is forgetting to include the forming of associations. Particularly when new instances are created, it is very likely that associations to several objects need be established. Don't forget! 9

Conclusion Identify Use-Cases in the system. How is it going to be used? From the Use-Cases, understand what are the Events in the system (triggers received from the user/external system). These are the inputs triggering the system to react. Events can be displayed in a special type of Sequence Diagram called System Sequence Diagram (Actor vs. System, only!). Identify classes in the Use-Cases and create a Conceptual Class Model. The system reacts by operating: thus, we are met with System Operations. These are the operations required in order to properly handle the triggers from outside the system. To define the System Operations more properly, write Contracts specifying an operation’s pre- and-post- conditions. Consider the Domain Model Class Diagram in the Post-Conditions. Finish by creating Sequence Diagrams for the operations. 10

Conclusion (Illustrated( Identify Use-Cases Events ~= triggers System Sequence Diagram (Actor vs. System, only!). System Operations Conceptual Classes (“nouns” in the Use-Cases) Contracts specifying post- conditions. Create Sequence Diagrams for operations. 11