Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.

Slides:



Advertisements
Similar presentations
Slide 12.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
Advertisements

10 Software Engineering Foundations of Computer Science ã Cengage Learning.
CS3773 Software Engineering Lecture 03 UML Use Cases.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/18 Use Case Analysis – continued Control Classes.
Use Case Diagram © copyright 2001 SNU OOPSLA Lab..
Object-Oriented Analysis and Design
Chapter 18 Object-Oriented Systems Analysis and Design Using UML
Slide 10B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 8B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Chapter 21 Object-Oriented Analysis
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Slide 7A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 6A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
1 CS1001 Lecture Overview Object Oriented Design Object Oriented Design.
Use Case Modeling. Kendall & Kendall© 2005 Pearson Prentice Hall18-2 Commonly Used UML Diagrams The most commonly used UML diagrams are: – Use case diagram,
Teamwork Know each other Compete Leadership Strengths and Weaknesses
Lecture 9 & 10: Finite Machines Anita S. Malik Adapted from Schach (2004) Chapter 11.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Chapter 7: The Object-Oriented Approach to Requirements
*Object-Oriented Design (Schach Chap 14)
Objects What are Objects Observations
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.
OBJECT-ORIENTED ANALYSIS PHASE
Slide 12.1 © The McGraw-Hill Companies, CS 4310: Software Engineering Lecture 7 Systems Analysis Object-Oriented Design.
Object Oriented Analysis By: Don Villanueva CS 524 Software Engineering I Fall I 2007 – Sheldon X. Liang, Ph. D.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
CSC 213 – Large Scale Programming Lecture 3: Object-Oriented Analysis.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
CS3320::CH111 OBJECT-ORIENTED ANALYSIS Chapter 11.
1 Analysis Extracting from Use Cases to Create Diagrams.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Lecture 3 Uses Cases Topics UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008 CSCE 492 Software Engineering.
Chapter 12: Design Phase n 12.1 Design and Abstraction n 12.2 Action-Oriented Design n 12.3 Data Flow Analysis n Data Flow Analysis Example n
Slide 13B.22 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Lecture 18: Object-Oriented Design – Interaction and State Diagrams Anita S. Malik Adapted from Schach (2004) Chapter 12.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Slide 12.1 Object-Oriented and Classical Software Engineering Chapter 12 Object Oriented Analysis.
Chapter 1 Applying UML and Patterns. The Need for Software Blueprints Knowing an object-oriented language and having access to a library is necessary.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 11 THE ANALYSIS WORKFLOW (Derived from Stephen R. Schach’s.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Engineering Zhang Shuang
PROC-1 1. Software Development Process. PROC-2 A Process Software Development Process User’s Requirements Software System Unified Process: Component Based.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
Slide 13.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
THE ANALYSIS WORKFLOW  The specification document  Informal specifications  The analysis workflow  Extracting the entity classes  Functional modeling:
Slide 12.1 © The McGraw-Hill Companies, 2007 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach.
CHAPTER 13 OBJECT-ORIENTED ANALYSIS. Overview l The analysis workflow l Extracting the entity classes l The elevator problem case study l The test workflow:
Software Engineering Zhang Shuang
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Lecture 14 22/10/15. The Object-Oriented Analysis and Design  Process of progressively developing representation of a system component (or object) through.
Unit-3 Identifying use cases Object Analysis Classification
CHAPTER 12 OBJECT-ORIENTED ANALYSIS. Overview Extracting the entity classes Object-oriented analysis: The elevator problem case study Functional modeling.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
Object-Oriented Systems. Goals Object-Oriented Methodologies – The Rumbaugh et al. OMT – The Booch methodology – Jacobson's methodologies.
CSCI 383 Object-Oriented Programming & Design Lecture 7 Martin van Bommel.
Slide 11.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.
Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R
Cmpe 589 Spring 2006.
The Movement To Objects
Object-Oriented Analysis (OOA)
Object-Oriented Analysis
Chapter 20 Object-Oriented Analysis and Design
Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach
Copyright 2007 Oxford Consulting, Ltd
Presentation transcript:

Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12

CS540 Software Design 2Lecture 14 & 15 Object-Oriented Paradigm Object-oriented paradigm Object-oriented paradigm Reaction to perceived shortcomings in structured paradigm Reaction to perceived shortcomings in structured paradigm Problem of larger products Problem of larger products Data and action treated as equal partners Data and action treated as equal partners

CS540 Software Design 3Lecture 14 & 15 Object-Oriented Paradigm (contd) Object consists of Object consists of Data (attributes, state variables, instance variables, fields, data members), and Data (attributes, state variables, instance variables, fields, data members), and Actions (methods, member functions) Actions (methods, member functions) Objects are independent units Objects are independent units Conceptual independence Conceptual independence Physical independence Physical independence

CS540 Software Design 4Lecture 14 & 15 Object-Oriented Analysis (OOA) Semi-formal specification technique Semi-formal specification technique Multiplicity of different methods Multiplicity of different methods Booch Booch OMT OMT Objectory Objectory Shlaer-Mellor Shlaer-Mellor Coad-Yourdon Coad-Yourdon All essentially equivalent All essentially equivalent Nowadays, we represent OOA using UML (unified modeling language) Nowadays, we represent OOA using UML (unified modeling language)

CS540 Software Design 5Lecture 14 & 15 The Three Steps of OOA 1.Use-case modeling 1.Use-case modeling Determine how the various results are computed by the product (without regard to sequencing) Determine how the various results are computed by the product (without regard to sequencing) Largely action oriented Largely action oriented 2.Class modeling (“object modeling”) 2.Class modeling (“object modeling”) Determine the classes and their attributes Determine the classes and their attributes Purely data-oriented Purely data-oriented 3.Dynamic modeling 3.Dynamic modeling Determine the actions performed by or to each class Determine the actions performed by or to each class Purely action-oriented Purely action-oriented Iterative process Iterative process

CS540 Software Design 6Lecture 14 & 15 Elevator Problem: OOA 1. Use-Case Modeling 1. Use-Case Modeling Use case: Generic description of overall functionality Use case: Generic description of overall functionality Get comprehensive insight into behavior of product Get comprehensive insight into behavior of product

CS540 Software Design 7Lecture 14 & 15 Normal Scenario

CS540 Software Design 8Lecture 14 & 15 Exception Scenario

CS540 Software Design 9Lecture 14 & 15 Use Case Use Case Name Use Case Name Actors Actors Pre-Conditions Pre-Conditions Normal Flow Normal Flow Post-Conditions Post-Conditions Exceptions or Alternate Flows Exceptions or Alternate Flows

CS540 Software Design 10Lecture 14 & 15 Class Modeling Extract classes and their attributes Extract classes and their attributes Represent them using an entity-relationship diagram Represent them using an entity-relationship diagram Deduce the classes from use cases and their scenarios Deduce the classes from use cases and their scenarios Often there are many scenarios Often there are many scenarios Possible danger: too many candidate classes Possible danger: too many candidate classes

CS540 Software Design 11Lecture 14 & 15 Two Approaches to Class Modeling Noun extraction Noun extraction Always works Always works CRC classes CRC classes Need to have domain expertise Need to have domain expertise

CS540 Software Design 12Lecture 14 & 15 Noun Extraction Stage 1. Concise Problem Definition Stage 1. Concise Problem Definition Define product in single sentence Define product in single sentence Buttons in elevators and on the floors control the motion of n elevators in a building with m floors. Buttons in elevators and on the floors control the motion of n elevators in a building with m floors.

CS540 Software Design 13Lecture 14 & 15 Noun Extraction (contd) Stage 2. Informal Strategy Stage 2. Informal Strategy Incorporate constraints, express result in a single paragraph Incorporate constraints, express result in a single paragraph Buttons in elevators and on the floors control movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator to stop at a specific floor; illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed. Buttons in elevators and on the floors control movement of n elevators in a building with m floors. Buttons illuminate when pressed to request the elevator to stop at a specific floor; illumination is canceled when the request has been satisfied. When an elevator has no requests, it remains at its current floor with its doors closed.

CS540 Software Design 14Lecture 14 & 15 Noun Extraction (contd) Stage 3. Formalize the Strategy Stage 3. Formalize the Strategy Identify nouns in informal strategy. Use nouns as candidate classes Identify nouns in informal strategy. Use nouns as candidate classes Nouns Nouns button, elevator, floor, movement, building, illumination, door button, elevator, floor, movement, building, illumination, door floor, building, door are outside problem boundary — exclude floor, building, door are outside problem boundary — exclude movement and illumination are abstract nouns — exclude (may become attributes) movement and illumination are abstract nouns — exclude (may become attributes) Candidate classes: Elevator and Button Candidate classes: Elevator and Button Subclasses: Elevator Button and Floor Button Subclasses: Elevator Button and Floor Button

CS540 Software Design 15Lecture 14 & 15 First Iteration of Class Diagram Problem Problem Buttons do not communicate directly with elevators Buttons do not communicate directly with elevators We need an additional class: Elevator Controller We need an additional class: Elevator Controller

CS540 Software Design 16Lecture 14 & 15 Second Iteration of Class Diagram All relationships are now 1-to-n All relationships are now 1-to-n Makes design and implementation easier Makes design and implementation easier

CS540 Software Design 17Lecture 14 & 15 CRC Cards Class Responsibility Collaboration (CRC) Class Responsibility Collaboration (CRC) Used since 1989 for OOA Used since 1989 for OOA For each class, fill in card showing For each class, fill in card showing Name of class Name of class Functionality (responsibility) Functionality (responsibility) List of classes it invokes (collaboration) List of classes it invokes (collaboration) Now automated (CASE tool component) Now automated (CASE tool component) Strength Strength When acted out by team members, powerful tool for highlighting missing or incorrect items When acted out by team members, powerful tool for highlighting missing or incorrect items Weakness Weakness Domain expertise is needed Domain expertise is needed

CS540 Software Design 18Lecture 14 & Dynamic Modeling Produce UML state diagram Produce UML state diagram State, event, predicate distributed over state diagram State, event, predicate distributed over state diagram UML “guards” are in brackets UML “guards” are in brackets

CS540 Software Design 19Lecture 14 & 15 Testing during the OOA Phase CRC cards are an excellent testing technique CRC cards are an excellent testing technique

CS540 Software Design 20Lecture 14 & 15 CRC Cards Consider responsibility Consider responsibility 1.Turn on elevator button 1.Turn on elevator button Totally unacceptable for object-oriented paradigm Totally unacceptable for object-oriented paradigm Responsibility-driven design ignored Responsibility-driven design ignored Information hiding ignored Information hiding ignored Responsibility Responsibility 1.Turn on elevator button should be 1.Send message to Elevator Button to turn itself on

CS540 Software Design 21Lecture 14 & 15 CRC Cards (contd) A class has been overlooked A class has been overlooked Elevator doors have a state that changes during execution (class characteristic) Elevator doors have a state that changes during execution (class characteristic) Add class Elevator Doors Add class Elevator Doors Safety considerations Safety considerations Reconsider class model Reconsider class model Then reconsider dynamic model, use-case model Then reconsider dynamic model, use-case model

CS540 Software Design 22Lecture 14 & 15 Second Iteration of CRC Card

CS540 Software Design 23Lecture 14 & 15 Third Iteration of Class Diagram

CS540 Software Design 24Lecture 14 & 15 Second Iteration of Normal Scenario

CS540 Software Design 25Lecture 14 & 15 Elevator Problem: OOA (contd) All three models are now fine All three models are now fine We should rather say: We should rather say: All three models are fine for now All three models are fine for now We may need to return to the object- oriented analysis phase during the object- oriented design phase We may need to return to the object- oriented analysis phase during the object- oriented design phase

CS540 Software Design 26Lecture 14 & 15 Why Is All This Iteration Needed? Perhaps the method is not yet mature? Perhaps the method is not yet mature? Waterfall model (explicit feedback loops) Waterfall model (explicit feedback loops) Rapid prototyping model (aim: to reduce iteration) Rapid prototyping model (aim: to reduce iteration) Incremental model, and Incremental model, and Spiral model Spiral model Latter two explicitly reflect iterative approach Latter two explicitly reflect iterative approach Iteration is an intrinsic property of all software production Iteration is an intrinsic property of all software production Especially for medium- and large-scale products Especially for medium- and large-scale products Expect iteration in the object-oriented paradigm Expect iteration in the object-oriented paradigm

CS540 Software Design 27Lecture 14 & 15 CASE tools for OOA phase Diagrams play a major role Diagrams play a major role Diagrams often change Diagrams often change Need a diagramming tool Need a diagramming tool Many tools go further Many tools go further All modern tools support UML All modern tools support UML Example Example Rose Rose

CS540 Software Design 28Lecture 14 & 15 Air Gourmet Case Study: OOA Use-case model for making a reservation Use-case model for making a reservation

CS540 Software Design 29Lecture 14 & 15 Making a Reservation: Extended Scenario

CS540 Software Design 30Lecture 14 & 15 Air Gourmet Case Study: OOA Use-case for returning and scanning a postcard Use-case for returning and scanning a postcard

CS540 Software Design 31Lecture 14 & 15 Postcards: Extended Scenario

CS540 Software Design 32Lecture 14 & 15 Air Gourmet Case Study: Class Modeling Stage 1. Concise Problem Definition Stage 1. Concise Problem Definition Define product in single sentence Define product in single sentence A computerized system is needed to provide information regarding the efficacy of a special meals program. A computerized system is needed to provide information regarding the efficacy of a special meals program.

CS540 Software Design 33Lecture 14 & 15 Air Gourmet Case Study: Noun Extraction (contd) Stage 2. Informal Strategy Stage 2. Informal Strategy Incorporate constraints, express result in a single paragraph Incorporate constraints, express result in a single paragraph Reports are to be generated to document the efficacy of the special meals program. The reports concern meals loaded on flights, flights boarded by passengers, names and addresses of passengers, meal quality, and low-sodium meals. Reports are to be generated to document the efficacy of the special meals program. The reports concern meals loaded on flights, flights boarded by passengers, names and addresses of passengers, meal quality, and low-sodium meals.

CS540 Software Design 34Lecture 14 & 15 Air Gourmet Case Study: Noun Extraction (contd) Stage 3. Formalize the Strategy Stage 3. Formalize the Strategy Identify nouns in informal strategy. Use nouns as candidate classes Identify nouns in informal strategy. Use nouns as candidate classes Nouns Nouns report, efficacy, program, percentage, meal, flight, boarding, passenger, name, address, quality report, efficacy, program, percentage, meal, flight, boarding, passenger, name, address, quality efficacy, program, percentage, boarding, quality are abstract nouns — exclude (may become attributes) efficacy, program, percentage, boarding, quality are abstract nouns — exclude (may become attributes) name, address are attributes of passenger name, address are attributes of passenger Question: Should meal and flight be classes? Question: Should meal and flight be classes? It is easier to add classes than to remove them It is easier to add classes than to remove them Candidate classes: Report and Passenger Candidate classes: Report and Passenger

CS540 Software Design 35Lecture 14 & 15 First Iteration of Class Diagram) Problems with this class diagram Problems with this class diagram Data for reports are needed on a per-flight basis Data for reports are needed on a per-flight basis Each report has to access multiple flights Each report has to access multiple flights Each flight has multiple passengers Each flight has multiple passengers Six reports (not four) are needed Six reports (not four) are needed

CS540 Software Design 36Lecture 14 & 15 Second Iteration of Class Diagram (contd) Cause of our problems Cause of our problems Flight should have been a candidate class Flight should have been a candidate class BUT, we all have 20–20 hindsight BUT, we all have 20–20 hindsight

CS540 Software Design 37Lecture 14 & 15 Air Gourmet Case Study: Dynamic Model State diagram State diagram

CS540 Software Design 38Lecture 14 & 15 Challenges of the OOA Phase Do not class the boundary into object-oriented design Do not class the boundary into object-oriented design Do not allocate methods to classes yet Do not allocate methods to classes yet