1 ECE 355: Software Engineering Bridge Material Object Oriented Design.

Slides:



Advertisements
Similar presentations
Requirements Elicitation and Use Case Diagrams
Advertisements

© 2010 Bennett, McRobb and Farmer1 Use Case Description Supplementary material to support Bennett, McRobb and Farmer: Object Oriented Systems Analysis.
Modeling ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Extending the Requirements Model - techniques for detailing use cases
Objectives Detailed Object-Oriented Requirements Definitions
CS3773 Software Engineering Lecture 03 UML Use Cases.
Sucha Smanchat  Steps in OOAD using UML  Use Case Diagram  Sequence Diagram / Communication Diagram  Class Diagram  State.
Chapter 18 Object-Oriented Systems Analysis and Design Using UML
Systems Analysis and Design in a Changing World, Fourth Edition
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Pohang University of Science and Technology (POSTECH) Copyright © 2003 SE Lab. Dept. of CSE POSTECH, R.O. Korea Vending Machine Modeling 2003 Fall Software.
Solving the Problem Analysis & Design.
Documenting Requirements using Use Case Diagrams
© 2005 Prentice Hall4-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
COMP1007 Intro to Systems Requirements © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to System Requirements Lecture 2 Use-Cases.
Requirements Analysis 4. 1 Use Case I b504.ppt © Copyright De Montfort University 2000 All Rights Reserved INFO2005 Requirements Analysis Use-Cases.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Unified Modeling Language 7/12/2015B.Ramamurthy1 The Unified Modeling Language™ (UML) was developed jointly by Grady Booch, Ivar Jacobson, and Jim Rumbaugh.
Blaha and Rumbaugh Sections 7.2 and 8.2
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
Chapter 7: The Object-Oriented Approach to Requirements
Use Case Analysis SWENET REQ3 Module July 2003
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
Chapter 3 Use Cases.
Interaction Modeling. Overview The class model describes the objects in a system and their relationships, the state model describes the life cycles of.
Interaction Modeling. Introduction (1) Third leg of the modeling tripod. It describes interaction within a system. The class model describes the objects.
Unified Modeling Language, Version 2.0
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
Requirement Engineering. Review of Last Lecture Problems with requirement Requirement Engineering –Inception (Set of Questions) –Elicitation (Collaborative.
4 2009/10 Object Oriented Technology 1 Topic 4: The Object-Oriented Approach to Requirements Adopted from: Ch.7 The Object-Oriented Approach to Requirements.
Systems Analysis and Design in a Changing World, 6th Edition
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.
11 Partnership for Performance How to hear this lecture Click on the icon: to hear the narration for each slide.
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
1 Analysis Extracting from Use Cases to Create Diagrams.
Requirements Documentation CSCI 5801: Software Engineering.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
UML-1 3. Capturing Requirements and Use Case Model.
Object Oriented Methodologies
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
1 Chapter 5 Modeling System Requirements Finding the Use Cases Page
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
Requirements specification Why is this the first major stage of software development? –Need to understand what customer wants first Goal of requirements.
Systems Analysis and Design in a Changing World, Fourth Edition
IntellAgile Copyright © 2002 Craig Larman. All rights reserved. Writing Use Cases: Requirements in Context.
Larman chapter 61 Use cases Larman chapter 6. 2 Fig. 6.1.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
7 Systems Analysis – ITEC 3155 The Object Oriented Approach – Use Cases.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
SWE 214 (071) Introduction to UML Slide 1 Introduction to UML.
1 An Overview of UML. 2 The Unified Modeling Language UML is a graphical language used by software engineers to model software systems during development.
Systems Analysis and Design in a Changing World, Fourth Edition
Systems Analysis and Design in a Changing World, 6th Edition
Vision Document Use Case Diaram
Dynamic Modeling of Banking System Case Study - I
Unified Modeling Language
Use Case Modeling - techniques for detailing use cases
Systems Analysis and Design in a Changing World, 6th Edition
Real-time (OO) Systems Design Using UML
Modeling ECE 417/617: Elements of Software Engineering Stan Birchfield
Modeling ECE 417/617: Elements of Software Engineering Stan Birchfield
Unified Modeling Language
Engineering Quality Software
Use cases Dr. X.
Presentation transcript:

1 ECE 355: Software Engineering Bridge Material Object Oriented Design

2 Overview  What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling Behavioral modeling –Design Interaction diagrams Refined class diagram Concurrency and scheduling Summary and Further Reading

3 OO Analysis & Design Analysis –Domain level - modeling “real world” objects –Really: part of requirements engineering requirements development = elicitation + analysis + specification –Many domain objects will not make into the design –Domain structures usually make poor design structures Design –Assigning responsibilities to object –Taking “illities” (maintainability, reusability, etc.) and portability into account –Devising mechanisms

4 OO Analysis & Design Many methods (OMT, Booch, Unified Process, etc.) Similar goals and techniques

5 OO Analysis Activities Use case analysis –Mostly focused on writing text - one overview context diagram is often enough –Use cases are just a part of functional requirements (only the interactive ones) Structural analysis – domain modeling –Finding the “real-world” objects involved in the use cases and creating class diagrams to represent them Behavioral analysis –Creating activity diagrams and sequence diagrams to capture use case details Activity diagrams for business workflow Sequence diagrams for reactive behavior (also with timing) –Possibly creating state charts to capture external reactive behavior of the system and other domain objects

6 OO Design Activities Creating interaction diagrams and distributing responsibilities –Devising mechanisms and introducing design objects –Creating sequence diagrams –Creating collaboration diagrams Creating refined class diagrams Deciding on concurrency and scheduling model Possibly modeling detailed behavior of design objects using state charts

7 Overview What is OO Analysis & Design? Vending Machine Example –Analysis  Use case modeling Domain modeling Behavioral modeling –Design Interaction diagrams Refined class diagram Concurrency and scheduling Summary and Further Reading

8 Use Case Diagram As a Context Diagram Use Case 1 (Buy a drink) Customer Vending Machine

9 Use Case Diagram As a Context Diagram Use Case 1 (Buy a drink) Customer Vending Machine Use Case 2 (Restock) Agent

10 Different Forms of Use Cases “Casual version” –User story –A narrative Fully dressed –Formal sections Preconditions Main scenario Exception list … See “Writing effective use cases” by Alistair Cockburn, 2000

11 Use Case 1 (“Casual Version”) Consider a simplified vending machine, which is used to dispense soft drinks. The vending machine consists of a coin slot for inserting coins, a return tray for returning the customer's money and three buttons used to select Pepsi (tm), Coke (tm) or Dr. Pepper (tm). If the customer inserts coins and does not press a button within one minute, the coins will be returned automatically (no coin-return lever). If the customer selects a beverage which is out-of-stock (none left), the coins will also be returned. This vending machine does not provide change - it is up to the customer to insert only enough money to purchase a drink. If sufficient coins are inserted and a button with available beverages is pressed, the appropriate drink is dispensed, the corresponding button is illuminated for five seconds, and the coin slot moves the coins to the general storage area (i.e. the purchase has finished).

12 Use Case 1 (“Fully Dressed” Version) Primary actor: Customer Goal in context: Customer buys a drink Level: User level Stakeholders and Interests: Customer : wants to buy a drink Vendor: wants to get paid for any goods dispensed Preconditions: Machine is ready & awaiting interaction Minimum guarantee: Customer gets his coins back if no drink dispensed Success guarantees: Customer has the drink; vending machine has the money for the drink; Vending machine provides no change Trigger: Customer starts interaction with the machine

13 Use Case 1 (Cont’d) Main success scenario: 1.Customer inserts sufficient money into the coin slot 2.Customer pushes one of the three select buttons 3.The selected drink is dispensed. 4.The pushed select button lights up for 5 seconds. 5.Coins are taken by the machine. Extensions 1a.Customer inserts no or insufficient money. Pushing a selection button has no effect. 2a.Customer fails to push a button within 1 minute from insertion of the last coin. Coins are returned. 2b.Customer selects beverage out of stock. Coins are returned. Frequency of use: several per day Priority: 1 Implementation status: … Open issues: …

14 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling  Domain modeling Behavioral modeling –Design Interaction diagrams Refined class diagram Concurrency and scheduling Summary and Further Reading

15 Noun analysis Consider a simplified vending machine, which is used to dispense soft drinks. The vending machine consists of a coin slot for inserting coins, a return tray for returning the customer's money and three buttons used to select Pepsi (tm), Coke (tm) or Dr. Pepper (tm). If the customer inserts coins and does not press a button within one minute, the coins will be returned automatically (no coin-return lever). If the customer selects a beverage which is out-of-stock (none left), the coins will also be returned. This vending machine does not provide change - it is up to the customer to insert only enough money to purchase a drink. If sufficient coins are inserted and a button with available beverages is pressed, the appropriate drink is dispensed, the corresponding button is illuminated for five seconds, and the coin slot moves the coins to the general storage area (i.e. the purchase has finished).

16 Domain Model - Initial Class Diagram Shelf Vending Machine ReturnTray CoinSlot amount Button id litUp Contains  Contains  Customer Contains  Inserts coins into  Pushes  1 1 Contains  Drink 0..* 1 Contains  1

17 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling  Behavioral modeling –Design Interaction diagrams Refined class diagram Concurrency and scheduling Summary and Further Reading

18 Sequence Diagram for Use Case 1 (Main Scenario + Extensions 1a & 2b) customermachine insertMoney(x) insertMoney(y) m:=checkAmount(x+y) a:=checkAvailability(z) [!a] return() 5 sec lightUp() lightDown() moveCoins() dispenseDrink() push(z) [m&a]

19 Activity Diagram for Use Case 1 (Main Scenario + Extension 1a) Insert money Select drink Dispense drink Sufficient money? no yes VendingMachineCustomer money drink

20 State Chart for Vending Machine (Full behavior) Insert money (x) Ready Dispensing Entry/ dispense drink, light up button, take money Push button Z [sufficient money & drink Z in stock] after (5 seconds)/light down Push button Z [no drink Z]/ return money after (60 seconds)/ return money

21 Hierarchical State Chart Dispensing Entry/ dispense drink, light up button, take money Push button Z [sufficient money & drink Z in stock] after (5 seconds) Insert money (x) Coin slot empty Coin slot has money after (60 seconds)/return money Push button Z [no drink Z]/return money

22 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling Behavioral modeling –Design  Interaction diagrams Refined class diagram Concurrency and scheduling Summary and Further Reading

23 Sequence Diagram customercoinSlotbutton1controllershelfRel1shelfSens1 insertMoney(x) insertMoney(y) push() request(1) m:=checkAmount() getTotal() a:=checkAvailability() isEmpty() [!a] return() release() lightUp() close() lightDown() open() 5 sec moveCoins() [m&a]

24 Extension 2a customercoinSlot insertMoney(x) insertMoney(y) button1controller request(1) push() timer return() timeOut() insertMoney(x) insertMoney(y) close() set(60) reset() set(60) < 60 sec checkTime() 60 sec

25 Collaboration Diagram coinSlot button1 controller shelfRel shelfSens timer1 timer2 1: insertMoney(x) 2: push() 2.1: request(1) 2.1.2: m:=checkAmount() : getTotal() 2.1.3: a:=checkAvailability() : isEmpty() 2.1.4a [!a]: return() [m&a]: moveCoins() [m&a]: release() [m&a]: lightUp() 2.1.1: close() 3.2.2: lightDown() 3.1.1: open() 1.1: set(60) : reset() 2a: timeOut() 3: timeOut() 2.1.6: set(5) «self»

26 Additional Design Technique: CRC Cards CRC (class-responsibility- collaborator) cards –Index cards –Written in a design session –Focus on assigning responsibilities –Can be used in addition to interaction diagrams –Pioneered by ward Cunningham & Kent beck

27 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling Behavioral modeling –Design Interaction diagrams  Refined class diagram Concurrency and scheduling Summary and Further Reading

28 Refined Class Diagram Controller price: Integer request(Integer) checkAmount() checkAvailability() ShelfRel release() CoinSlot amount: Integer opened: Bool insertMoney(Int) close() open() getTotal() return() moveCoins() Button id: Integer litUp: Bool push() lightUp() lightDown() ShelfSens empty: Bool isEmpty() Timer set() reset() checkTime() Signals timeOut()

29 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling Behavioral modeling –Design Interaction diagrams Refined class diagram  Concurrency and scheduling Summary and Further Reading

30 Single Thread With Passive Objects Requires a top level control loop –Read input, compute, write output Calls to procedures performing the processing steps need to be scheduled manually Simple: no synchronization of concurrent threads or processes necessary May waste computing resources –“Polling style”

31 Passive objects design with a main control loop // main control loop while(true) { If (coinSlotSensor.coinInserted()) coinSlot.insertMoney(coinSlotSensor.amount()) ; If (buttonSensor1.pressed()) button1.push(); If (buttonSensor2.pressed()) button2.push(); If (buttonSensor3.pressed()) button3.push(); timer1.checkTime(); timer2.checkTime(); }

32 Active Objects Define a statechart for each object Communication through signals –E.g., SDL: asynchronous send, synchronous receive –Synchronous communication requires sending a request and waiting for the response –Avoid variables shared between processes No direct support by most programming languages –Need a framework/library Better utilization of computing resources Automatic scheduling

33 Overview What is OO Analysis & Design? Vending Machine Example –Analysis Use case modeling Domain modeling Behavioral modeling –Design Interaction diagrams Refined class diagram Concurrency and scheduling  Summary and Further Reading

34 Summary Analysis –Use case analysis - writing user stories –Structural analysis/domain modeling - finding “real-world” objects –Behavioral analysis Creating activity diagrams and sequence diagrams to capture use case details Creating state charts to capture external reactive behavior of the system and other domain objects Design –Creating interaction diagrams and distributing responsibilities –Creating refined class diagrams –Deciding on concurrency and scheduling model –Possibly modeling detailed behavior of design objects using state charts

35 Further Reading Recommended OO Analysis & Design book: –Applying UML & Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process” by Craig Larman, 2 nd edition, Prentice Hall, 2002