Slide 12.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.

Slides:



Advertisements
Similar presentations
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
Advertisements

Design CS 524 – Software Engineering I Fall I 2007 – Sheldon X. Liang, PH.D. Jeff Nogy.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Design. Overview Design and abstraction Action-oriented design Data flow analysis Transaction analysis Data-oriented design Object-oriented design Challenges.
Slide 11C.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Design Xiaojun Qi.
Slide 11D.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 7D.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
COMS W3156: Software Engineering, Fall 2001 Lecture #12: Design, Distributed Objects Janak J Parekh
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 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Slide 9.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 18.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 1.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach
Slide 7B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 8A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 5D.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
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 5C.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.
Slide 14.1 Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented and Classical Software Engineering Eighth Edition,
Slide 5B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 7E.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 10C.52 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
The chapter will address the following questions:
*Object-Oriented Design (Schach Chap 14)
Objects What are Objects Observations
OBJECT-ORIENTED ANALYSIS PHASE
Slide 12.1 © The McGraw-Hill Companies, CS 4310: Software Engineering Lecture 7 Systems Analysis Object-Oriented Design.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
CS540 Software Design Lecture 8 1 Lecture 8: Structured Design Anita S. Malik Adapted from Schach (2004) Chapter 13 and Appendix.
Team Skill 6: Building the Right System From Use Cases to Implementation (25)
DESIGN.
Slide 16.1 Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented and Classical Software Engineering Eighth Edition,
1 Analysis Extracting from Use Cases to Create Diagrams.
Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.
Software Engineering SI334 Lessons 24, 26 – 28 & 30: Classical & Object-Oriented Design October 6, 8, 10, 15, 2014.
Slide 10.1 Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented and Classical Software Engineering Eighth Edition,
Slide 6.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach
Slide 11C.104 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Systems Analysis and Design in a Changing World, 3rd Edition
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.
THE DESIGN WORKFLOW  Object-oriented design  The design workflow  The test workflow: Design  CASE tools for design  Challenges of the design workflow.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Slide 20.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
Slide 12A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Petri Nets Invented by Carl Adam Petri in 1962 Concurrent systems with timing problems  Synchronization, race problem, deadlock A petri net consists of.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Slide 13.1 © The McGraw-Hill Companies, 2002 Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach.
Slide 13.1 © The McGraw-Hill Companies, 2007 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 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.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Slide 10.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen.
CS451 Software Maintenance Yugi Lee STB #555 (816) Note: This lecture was designed based on Stephen Schach’s.
Slide 12F.135 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach
Design CS 470 – Software Engineering I Sheldon X. Liang, PH.D.
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2010 Stephen R. Schach
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
Slide 13A.1 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach.
1 of 53 THE OBJECT-ORIENTED DESIGN WORKFLOW. 2 of 53 Overview The Design Workflow Traditional versus Object-Oriented Design Formats of the Attributes.
Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R
CHAPTER 14 DESIGN.
Object-Oriented and Classical Software Engineering Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach
Object-Oriented and Classical Software Engineering Fifth Edition, WCB/McGraw-Hill, 2002 Stephen R. Schach
Presentation transcript:

Slide 12.1 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Software Engineering WCB/McGraw-Hill, 2008 Stephen R. Schach

Slide 12.2 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 12 THE DESIGN WORKFLOW

Slide 12.3 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Overview l Object-oriented design l Object-oriented design: The elevator problem case study l Object-oriented design: The MSG Foundation case study l The design workflow l The test workflow: Design l Formal techniques for detailed design l Real-time design techniques

Slide 12.4 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Overview (contd) l CASE tools for design l Metrics for design l Challenges of the design workflow

Slide 12.5 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Design Techniques l Operation-oriented design – The emphasis is on the operations – Weakness: The data are of secondary importance l Data-oriented design – The emphasis is on the data – Weakness: The operations are of secondary importance l Object-oriented design – Gives equal weight to data and operations

Slide 12.6 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Object-Oriented Design l Aim – Design the product in terms of the classes extracted during the analysis workflow l If we are using a language without inheritance (e.g., C, Ada 83) – Use abstract data type design l If we are using a language without a type statement (e.g., FORTRAN, COBOL) – Use data encapsulation

Slide 12.7 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Design Steps l OOD consists of two steps: l Step 1.Complete the class diagram – Determine the formats of the attributes – Assign each method, either to a class or to a client that sends a message to an object of that class l Step 2.Perform the detailed design

Slide 12.8 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Design Steps (contd) l Step 1. Complete the class diagram – The formats of the attributes can be directly deduced from the analysis artifacts l Example: Dates – U.S. format mm/dd/yyyy – European format dd/mm/yyyy – In both instances, 10 characters are needed l The formats could be added during analysis – To minimize rework, never add an item to a UML diagram until strictly necessary

Slide 12.9 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Design Steps (contd) l Assign each method, either to a class or to a client that sends a message to an object of that class l Principle A: Information hiding l Principle B: If an operation is invoked by many clients of an object, assign the method to the object, not the clients l Principle C: Responsibility-driven design

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Object-Oriented Design Steps (contd) l Step 2. Perform the detailed design – Design each class in detail l Select specific algorithms l Choose data structures

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Detailed Design of Method find of Class Mortgage Figure 12.1

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Detailed Design in PDL l We can also write a detailed design in a program description language (PDL) – Formerly called pseudocode l Next two slides: l Java-like PDL description of detailed design of – Method computeEstimatedFunds of class EstimatedFundsForWeek – Method totalWeeklyNetPayments of class Mortgage

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Method EstimatedFundsForWeek. computeEstimatedFunds Figure 12.2

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Method Mortgage. totalWeeklyNetPayments Figure 12.3

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Object-Oriented Design: Elevator Problem l Step 1. Complete the class diagram l Assign the operations to the class diagram

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. OOD: Elevator Problem Case Study (contd) l CRC card Figure 11.9 (again)

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. OOD: Elevator Problem Case Study (contd) l Responsibilities – 8. Start timer – 10. Check requests, and – 11. Update requests are assigned to the Elevator Controller Class l Because they are carried out by the elevator controller

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. OOD: Elevator Problem Case Study (contd) l The remaining eight responsibilities have the form – “Send a message to another class to tell it do something” l These should be assigned to that other class – Responsibility-driven design – Safety considerations Methods openDoors, clos eDoors are assigned to Elevator Doors Class Methods turnOffBu tton, turnOnButton are assigned to Floor Button Class and Elevator Problem Class

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Figure 12.4 Detailed Class Diagram: Elevator Problem

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Detailed Design: Elevator Problem Detailed design of elevatorEventLoop is constructed from the statechart Figure 12.5

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Object-Oriented Design: MSG Foundation l Step 1. Complete the class diagram l The final class diagram is shown in the next slide – Date Class is needed for C++ – Java has built-it functions for handling dates

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Final Class Diagram: MSG Foundation Figure 12.6

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Class Diagram with Attribute Formats: MSG Foundation Figure 12.7

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Assigning Methods to Classes: MSG Foundation Example: setAssetNumber, getAssetNumber – From the inheritance tree, these accessor/mutator methods should be assigned to Asset Class – So that they can be inherited by both subclasses of Asset Class (Investment Class and Mortgage Class) Figure 12.8

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Assigning Methods to Classes: MSG Foundation (contd) l Assigning the other methods is equally straightforward – See Appendix F

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Detailed Design: MSG Foundation l Step 2. Perform the detailed design l Determine what each method does l Represent the detailed design in an appropriate format – Tabular format for method find of class Mortgage » (see Slide 12.11) – PDL (pseudocode) for method computeEstimatedFunds of class EstimatedFundsForWeek and for method totalWeeklyNetPayments of class Mortgage » (see Slides 12.13, 12.14)

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved The Design Workflow l Summary of the design workflow: – The analysis workflow artifacts are iterated and incremented until the programmers can utilize them l Decisions to be made include: – Implementation language – Reuse – Portability

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l The idea of decomposing a large workflow into independent smaller workflows (packages) is carried forward to the design workflow l The objective is to break up the upcoming implementation workflow into manageable pieces – Subsystems l It does not make sense to break up the MSG Foundation case study into subsystems — it is too small

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l Why the product is broken into subsystems: – It is easier to implement a number of smaller subsystems than one large system – If the subsystems are independent, they can be implemented by programming teams working in parallel » The software product as a whole can then be delivered sooner

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l The architecture of a software product includes – The various components – How they fit together – The allocation of components to subsystems l The task of designing the architecture is specialized – It is performed by a software architect

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l The architect needs to make trade-offs – Every software product must satisfy its functional requirements (the use cases) – It also must satisfy its nonfunctional requirements, including » Portability, reliability, robustness, maintainability, and security – It must do all these things within budget and time constraints l The architect must assist the client by laying out the trade-offs

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l It is usually impossible to satisfy all the requirements, functional and nonfunctional, within the cost and time constraints – Some sort of compromises have to be made l The client has to – Relax some of the requirements; – Increase the budget; and/or – Move the delivery deadline

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. The Design Workflow (contd) l The architecture of a software product is critical – The requirements workflow can be fixed during the analysis workflow – The analysis workflow can be fixed during the design workflow – The design workflow can be fixed during the implementation workflow l But there is no way to recover from a suboptimal architecture – The architecture must immediately be redesigned

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved The Test Workflow: Design l Design reviews must be performed – The design must correctly reflect the specifications – The design itself must be correct l Transaction-driven inspections – Essential for transaction-oriented products – However, they are insufficient — specification-driven inspections are also needed

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved The Test Workflow: MSG Foundation l A design inspection must be performed – All aspects of the design must be checked l Even if no faults are found, the design may be changed during the implementation workflow

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Formal Techniques for Detailed Design l Implementing a complete product and then proving it correct is hard l However, use of formal techniques during detailed design can help – Correctness proving can be applied to module-sized pieces – The design should have fewer faults if it is developed in parallel with a correctness proof – If the same programmer does the detailed design and implementation » The programmer will have a positive attitude to the detailed design » This should lead to fewer faults

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Real-Time Design Techniques l Difficulties associated with real-time systems – Inputs come from the real world » Software has no control over the timing of the inputs – Frequently implemented on distributed software » Communications implications » Timing issues – Problems of synchronization » Race conditions » Deadlock (deadly embrace)

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Real-Time Design Techniques (contd) l The major difficulty in the design of real-time systems – Determining whether the timing constraints are met by the design

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Real-Time Design Techniques (contd) l Most real-time design methods are extensions of non-real-time methods to real-time l We have limited experience in the use of any real- time methods l The state-of-the-art is not where we would like it to be

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved CASE Tools for Design l It is critical to check that the design artifacts incorporate all aspects of the analysis – To handle analysis and design artifacts we therefore need upperCASE tools l UpperCASE tools – Are built around a data dictionary – They incorporate a consistency checker, and – Screen and report generators – Management tools are sometimes included, for » Estimating » Planning

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. CASE Tools for Design (contd) Data dictionary entries for class Asset Figure 12.9

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. CASE Tools for Design (contd) l Examples of tools for the design workflow – Commercial tools » Software through Pictures » IBM Rational Rose » Together – Open-source tool » ArgoUML

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Metrics for Design l Measures of design quality – Cohesion – Coupling – Fault statistics l Cyclomatic complexity is problematic – Data complexity is ignored – It is not used much with the object-oriented paradigm

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Metrics for Design (contd) l Metrics have been put forward for the object- oriented paradigm – They have been challenged on both theoretical and experimental grounds

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved Challenges of the Design Workflow l The design team should not do too much – The detailed design should not become code l The design team should not do too little – It is essential for the design team to produce a complete detailed design

Slide Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Challenges of the Design Phase (contd) l We need to “grow” great designers l Potential great designers must be – Identified, – Provided with a formal education, – Apprenticed to great designers, and – Allowed to interact with other designers l There must be a specific career path for these designers, with appropriate rewards