CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812) 877-8974

Slides:



Advertisements
Similar presentations
Use Case & Use Case Diagram
Advertisements

CSSE 374: Object-Oriented Design Exercise Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and.
Object Design Examples with GRASP
Robert B. Jackson Brigham Young University John W. Satzinger
Information System Engineering
CSSE 374: Introduction to Object- Oriented Analysis and Design Q1 Steve Chenoweth Office: Moench Room F220 Phone: (812)
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.
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;
Solving the Problem Analysis & Design.
NJIT Use Case Model Operation Contracts Prepared By: Sumit Sharma.
PROCESS MODELING Transform Description. A model is a representation of reality. Just as a picture is worth a thousand words, most models are pictorial.
ACS-3913Fall 2009 Ron McFadyen1 Contracts Used to help understand requirements more completely (and so may not always be necessary) based on assertions;
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.
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.
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: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others.
CSSE 374: Domain Model Refinements and Iteration 3 Preparations Q1 These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo, and others.
CSSE 374: Interaction Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others derived.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
CSSE 374: GRASP’ing at the First Five Patterns Principles Steve Chenoweth Office: Moench Room F220 Phone: (812)
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
CSSE 374: More Object Design with Gang of Four Design Patterns Steve Chenoweth Office: Moench Room F220 Phone: (812)
Chandan Rupakheti Office: Moench Room F203 Phone: (812) These slides and others derived from Shawn Bohner, Curt.
Object-Oriented Analysis and Design Feb 4, 2009.
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.
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.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
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
Requirements Analysis and Design Engineering Southern Methodist University CSE 7313.
What to remember from Chap 13 (Logical architecture)
Larman ch. 131 Use-Case Model : Adding Detail with operation contracts Larman ch. 13.
Drawing System Sequence Diagrams
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
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.
System Sequence Diagram Chandan Rupakheti & Steve Chenoweth Week 5-3a.
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.
BTS430 Systems Analysis and Design using UML Domain Model—Part 2: Associations and Attributes.
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.
Software Engineering 1 Object-oriented Analysis and Design Chap 31 More SSDs and Contracts.
Use-Case Model: Adding Detail with Operation Contracts.
1 Design Model Use-Case realizations with GRASP Larman chapter 17.
DOMAIN MODEL—PART 2: ATTRIBUTES BTS430 Systems Analysis and Design using UML.
1 Object Oriented Analysis and Design System Events & Contracts.
OO Methodology Elaboration Phase Iteration 1- Part 2.
System Sequence Diagrams and Operation Contracts
Used to help understand requirements more completely
Starting Design: Logical Architecture and UML Package Diagrams
Using Use Case Diagrams
Operation Contracts Ch. 11.
Presentation transcript:

CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812) Chandan Rupakheti Office: Moench Room F203 Phone: (812) These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo, and others involved in delivering 374.

Store Address Phone# Customer name address phone# Video ID Transaction date Payment /amount: Money type authorization Initiates   Records- rental-of Pays-for  Transacts  Rents-from, Buys-from  Stocks  Selects  *1 1 * * 1 * 1..* * 1 Makes- Authorizes  1 1..* Rental dueDate ReturnDate ReturnTime VideoDescription title subjectCategory VideoSupplier address name newVideos Baske t Shelf location stock Membership ID startDate PricingPolicy perDayRentalCharge perDayLateCharge 1 Obtains  1 1  Maintains 1 * Determines- rental-charge  1 *  Contains 1 * * 1  Stores- video-on  Defines 1 *  Provides 1 * * Describes  Contains  1 0..*  Provides 1 0..* 1 1  Holds- videos-in 1

Learning Outcomes: O-O Design Demonstrate object-oriented design basics like domain models, class diagrams, and interaction (sequence and communication) diagrams. Introduce Operations Contracts (OCs) Do an Operations Contracts Exercise Transitioning from Requirements to Design Introduce Logical Architecture

Where are the Operations in the SSD? System Events => System Operations

Operation Contracts (OC) Used to give more details for system operations Together, all the system operations from all the use cases give the public system interface From SSDs, messages coming into the system Conceptually, it’s like the whole system is a single object and the system operations are its public methods

Parts of the Operation Contract 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. Q1

Example OC: Contract CO2: enterItem Operation:enterItem(itemID: ItemID, quantity: Integer) Cross Refs:Use Cases: Process Sale Preconditions : There is a sale underway Post- conditions:  a SalesLineItem instance, sli, was created  sli was associated with the current Sale  sli.quantity became quantity (attribute modification)  sli was associated with ProductDescription based on itemID match Q2 Most important section (At most) one OC per System Operation Any uses cases where this operation appears Noteworthy assumptions

Pre & Post-Conditions in Your Mind’s Eye Envision the system and it’s objects on an Extreme Makeover set… Before the operation, take a picture of the set The lights go out, and apply the system operation Lights on and take the after picture Compare the before and after pictures, and describe state changes as post-conditions

Pre- and Post-Conditions Pre-Conditions are what must be in place to invoke the operation Post-conditions are declarations about the Domain Model objects that are true when the operation has finished

Postconditions Describe changes in the state of objects in the Domain Model Typical sorts of changes:  Created instances  Deleted instances  Form associations  Break associations  Change attributes Q3,4 Not actions performed during the operation. Rather, observations about what is true after the operation. Not actions performed during the operation. Rather, observations about what is true after the operation.

Postconditions (continued) Q5 Express post-conditions in the past tense to emphasize they are declarations about a state change in the past Give names to instances Capture information from system operation by noting changes to domain objects Can be informal (somewhat)  a SalesLineItem instance, sli, was created  sli was associated with the current Sale  sli.quantity became quantity  sli was associated with a ProductDescription based on itemID match  a SalesLineItem instance, sli, was created  sli was associated with the current Sale  sli.quantity became quantity  sli was associated with a ProductDescription based on itemID match

Why OC Post-Conditions? Domain model =>objects attributes and associations OC links a system operation to specific objects in the domain model Indicates which objects are affected by the operation Will help with assignment of responsibilities

Contracts Lead to Domain Model Updates New Domain Model classes, attributes, and associations are often discovered while writing contracts Elaborate Domain Model as you think through the operation contracts

Use Operation Contracts When Detail and Precision are Important When details would make use cases too verbose When we don’t know the domain and want a deeper analysis (while deferring design) OCs help to validate the domain model

Creating Operation Contracts Identify System Operations from SSDs Make contracts for System Operations that are:  Complex and perhaps subtle in their own results  Not clear in the use case Again, in describing post-conditions use:  Instance creation and deletion  Attribute modification  Associations formed and broken Q6 Most frequent mistake in creating contracts: Forgetting to include forming of associations Most frequent mistake in creating contracts: Forgetting to include forming of associations

Class Exercise on Operations Contracts Break up into your project teams Look over the SSD from Tuesday looking for system operations and Read the Use Case again referring to the Domain Model Write an Operations Contract for MakePayment (method, amount)

SSD for Use Case 1 :System :Customer selectVideoToRent(ID,duration) Loop [more items] availability, videoList checkout totalWithTaxes, availableMethodsOfPayment makePayment(method, amount) changeDue, videos, returnInstructions, receipt

Homework 1: Basic Use Case 1/2 UC1: Customer rents videos  Preconditions: Customer has a membership, has selected videos they want, and made system aware of their choices. Main flow: 1. Actor indicates to rent first item (e.g., clicking "rent" on a networked device, or scanning it physically in a store) 2. System verifies immediate availability, and waits to make next option 3. Actor indicates they are done selecting 4. System shows total, prompts for payment 5. Actor selects method of payment, entering additional data if needed (e.g., credit card number) 6. System verifies the payment has gone through, schedules the goods for rental (e.g., sets up a window to click on to view the video remotely, or tells the store clerk where to find the DVD)… Postcondition: Rental transaction is complete

Concise DM For Video Store Store Address Phone# Customer name address phone# Video ID Transaction date Payment /amount: Money type authorization Rental dueDate ReturnDate ReturnTime Initiates   Records- rental-of Pays-for  X-acts  Rents-from  Stocks  Rents  *1 1 * 1 1..* 1 * * 1 Makes- Authorizes  1 1..*

Exercise: Complete the OC Operation: makePayment(method, amount) Cross references: Use Cases: UC1: Customer rents videos Preconditions: Customer has a membership, Customer has selected videos, and system aware of the customer choices Postconditions: Rental Transaction Complete, …Verified payment was received, receipt was printed, rented videos were readied for taking Q7

You can look at practically any part of anything manmade around you and think “some engineer was frustrated while designing this.” It's a little human connection.

Leaving Analysis Behind? Not really We’ll learn more about the problem while designing (and implementing) a solution  Refine the requirements when that happens  Choose high risk activities for early iterations to provoke changes to the requirements “Just enough” analysis is often useful Unknown/unusual activities are high risk

Logical Architecture A very short introduction

Where Are We? Package Diagram/Logical Architecture Domain Model Use Case Model including System Sequence Diagrams and Operation Contracts Design Model

Logical Architecture Large-scale organization of the software classes into:  Packages (a.k.a., namespaces)  Subsystems  Layers Logical, since implementation/deployment decisions are deferred Q8

Layered Architectures Very common for object-oriented systems Coarse-grained grouping of components based on shared responsibility for major aspects of system Typically higher layers call lower ones, but not vice-versa

Three Typical Architectural Layers 1. User Interface 2. Application Domain Layer 3. Technical Services:  Persistence  Logging  Rules Engine Heavily influenced by domain model Q9 Reusable across systems

Strict vs. Relaxed Layered Architectures Q10 Strict: only calls next layer down Relaxed: can call any layer below

Obtains Transacts PriciingPolicy Describes Store. 1 Provides Transaction. Rental. Shelf location stock 1 1..* ★ 1 Stores- video-on Selects Contains Basket Contains VideoSupplier address name newVideos Payment /amount: Money type authorization ★ 1 1 Holds-videos 1 Provides 1..* 1 Makes- Authorizes Buys-from,

System Operation Contracts