Lecture # 06 Design Principles II

Slides:



Advertisements
Similar presentations
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture # 16 Finalizing the Application Design SWE 316: Software Design and.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Object-Oriented Software Development CS 3331 Fall 2009.
Requirements and Design
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 14 Structural Design Patterns SWE 316: Software Design and Architecture.
2 Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how statecharts can be used to describe system behaviors  Use statecharts.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Design Patterns CS is not simply about programming
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
Managing Reuse Presented by: Aisha Al-Hammadi. Outline Introduction History. The technical and managerial advantages of Reusing Solutions. The main challenges.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
20 February Detailed Design Implementation. Software Engineering Elaborated Steps Concept Requirements Architecture Design Implementation Unit test Integration.
Systems Design. Analysis involves understanding and documenting user requirements in a clear and unambiguous way. It focuses on the business side and.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Chapter 4 Design Principles I Correctness and Robustness
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture # 05: Design Principles I - Correctness and Robustness SWE 316: Software.
Design Patterns.
Chapter 10 Introduction to Components. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFramework Detailed.
Prologue: The Software Process. Main Phases of Software Process 1. Requirements Analysis (answers “WHAT?”) Specifying what the application must do 2.
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.
An Introduction to Software Architecture
CSE 303 – Software Design and Architecture
Software Engineering Chapter 8 Fall Analysis Extension of use cases, use cases are converted into a more formal description of the system.Extension.
Comp2110 Software Design lecture 13Detailed Design (1)  detailed design contrasted with high level design  introducing the Observer Design Pattern 
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 7 Requirements and Domain Classes SWE 316: Software Design and Architecture.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 09. Review Introduction to architectural styles Distributed architectures – Client Server Architecture – Multi-tier.
Chapters 4&5 Design Principles: Correctness, Robustness, Flexibility, Reusability, and Efficiency.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
SWE 316: Software Design and Architecture Objectives Lecture # 15 Behavioral Design Patterns SWE 316: Software Design and Architecture  To learn the behavioral.
Object-Oriented Design Principles and Patterns. © 2005, James R. Vallino2 How Do You Design? What principles guide you when you create a design? What.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Jan. 29, 2002Grand Challenges in Simulation Issues in Enhancing Model Reuse C. Michael Overstreet Richard E. Nance Osman Balci.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Structural Design Patterns
Chapter 6 Introduction to Design Patterns. Process Phase Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
Chapter 1 Programming Review and Introduction to Software Design.
Chapter 4 Design Principles I Correctness and Robustness.
Alternative Architecture for Information in Digital Libraries Onno W. Purbo
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 13 Creational Design Pattern SWE 316: Software Design and Architecture.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Software Design Process
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Introduction to Software Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
© 2010 John Wiley & Sons Ltd. Software Engineering Modern Approaches Eric Braude and Michael Bernstein 1.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Software Reuse Course: # The Johns-Hopkins University Montgomery County Campus Fall 2000 Session 4 Lecture # 3 - September 28, 2004.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Chapter 8 Object Design Reuse and Patterns. More Patterns Abstract Factory: Provide manufacturer independence Builder: Hide a complex creation process.
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Introduction to OOAD and UML
소프트웨어재사용 방법론 - Design guidelines for Tailorable Frameworks - Object oriented development method for reconfigurable embedded systems 김기환.
COMP2110 Software Design in lecture 14 Patterns(1) /Detailed Design
…… Notes …… Lecture 8: Structural Design Patterns Monday Nov 05, 2012
CSC 222: Computer Programming II
Lecture 2 of Computer Science II
TIM 58 Chapter 8: Class and Method Design
Informatics 122 Software Design II
Object Oriented Design Patterns - Structural Patterns
Software Design Lecture : 9.
Presentation transcript:

Lecture # 06 Design Principles II SWE 316: Software Design and Architecture Lecture # 06 Design Principles II Flexibility, Reusability, & Efficiency Ch 5 Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Aspects of Flexibility Reusability Efficiency Trade-off between Principles 2/24 Aspects of Flexibility Flexible design implies a design that easily can accommodate the changes Anticipate.. … adding more of the same kind of functionality Example (banking application): handle more kinds of accounts without having to change the existing design or code … adding different functionality Example: add withdraw function to existing deposit functionality … changing functionality Example: allow overdrafts

Registering Website Members Flexibility Reusability Efficiency Trade-off between Principles 3/24 Registering Website Members members 0..n WebSite register() Member Example: Registering members at a web site (Design 1) What’s wrong with this design? Difficult to add new type of members since it is fixed here. It’s better to have member as abstract class.

Registering Website Members Flexibly Flexibility Reusability Efficiency Trade-off between Principles 4/24 Registering Website Members Flexibly members 0..n WebSite Member YMember XMember StandardMember Example: Registering members at a web site (Design 2: a flexible design)

Adding Functionality to an Application Flexibility Reusability Efficiency Trade-off between Principles 5/24 Adding Functionality to an Application Alternative Situations Accommodate adding new kinds of functionality Adding functionality to an application: alternative situations: Within the scope of … Within the scope of a list of related functions Example: add print to an air travel itinerary functions Within the scope of an existing base class Example: add “print road- and ship- to air itinerary ” Within the scope of: neither Example: add “print itineraries for combinations of air, road and ship transportation”

Adding Functionality When a Base Class Exists Flexibility Reusability Efficiency Trade-off between Principles 6/24 Adding Functionality When a Base Class Exists Trip printItinerary() SomeApplicationClass Method(s) call printItinerary() StandardTrip printItinerary() Case 1: Case 1 can be handled by adding the new method to an existing set of methods of a class Add method print() to the class Itinerary.

Adding Functionality Through a Base Class Flexibility Reusability Efficiency Trade-off between Principles 7/24 Adding Functionality Through a Base Class Trip printItinerary() SomeApplicationClass StandardTrip printItinerary() LandTrip printItinerary() SeaTrip printItinerary() Case 2: Adding functionality when a base class exists Case 3: covered later (chapter 9)

Additional Type of Flexibiliy Flexibility Reusability Efficiency Trade-off between Principles 8/24 Additional Type of Flexibiliy Flexibility Aspect: ability to … Described in … … create objects in variable configurations determined at runtime “Creational” design patterns … create variable trees of objects or other structures at runtime “Structural” design patterns … change, recombine, or otherwise capture the mutual behavior of a set of objects “Behavioral” design patterns … create and store a possibly complex object of a class. … configure objects of predefined complex classes – or sets of classes – so as to interact in many ways Component technology – chapter 10 Ch 7 Ch 8 Ch 9 Ch 10

Trade-off between Principles Flexibility Reusability Efficiency Trade-off between Principles 9/24 Reusability Designing a software system such that components of a developed system can be used again in developing new applications Reusability is an important factor in producing low cost applications Reusability at the architectural/design level (design patterns) Reusability at the implemented component level (design components) Our focus in this chapter is to cover: Reusable functions Reusable classes Reusable class combinations

Reusability of function design Flexibility Reusability Efficiency Trade-off between Principles 10/24 Reusability of function design Simple methods Guidelines for designing reusable methods Reusable methods must be defined completely Reusable methods must be independent of their environment, e.g., Static methods Makes the design looser coupling, less coherent and less object- oriented. Name of a reusable method must be reflective of its functionality

Making a Method Re-usable Flexibility Reusability Efficiency Trade-off between Principles 11/24 Making a Method Re-usable Specify completely Preconditions etc Avoid unnecessary coupling with the enclosing class Make static if feasible Include parameterization i.e., make the method functional But limit the number of parameters Make the names expressive Understandability promotes re-usability Explain the algorithm Re-users need to know how the algorithm works

Making a Class Re-usable Flexibility Reusability Efficiency Trade-off between Principles 12/24 Making a Class Re-usable Describe the class completely Make the class name and functionality match a real world concept Define a useful abstraction attain broad applicability Reduce dependencies on other classes Elevate dependencies in hierarchy alternatives

Reducing Dependency Among Classes Flexibility Reusability Efficiency Trade-off between Principles 13/24 Reducing Dependency Among Classes Replace … Student Course With !!! What do you think? Student Course Enrollment Increase the reusability of a class by reducing its dependencies.

Leveraging Inheritance, Aggregation and Dependency Flexibility Leveraging Inheritance, Aggregation and Dependency Reusability Efficiency Trade-off between Principles 14/24 Customer computeBill() (1) Leveraging inheritance RegularCustomer computeBill() Customer computeBill() (2) Leveraging aggregation Customer computeBill() Bill compute() Customer computeBill( Orders ) Orders value() (3) Leveraging dependency

Trade-off between Principles Flexibility Reusability Efficiency Trade-off between Principles 15/24 Efficiency Applications must execute required functionality within required time constraints Two dimensions of efficiency: time and space Ideally optimize a design for both time and space

Space-Time Trade-offs Flexibility Reusability Efficiency Trade-off between Principles 16/24 Space-Time Trade-offs Time to process one item Typical target Space

Basic Approaches to Time Efficiency Flexibility Reusability Efficiency Trade-off between Principles 17/24 Basic Approaches to Time Efficiency Design for Other Criteria, Then Consider Efficiency Design for flexibility, reusability , … At some point, identify inefficient places Make targeted changes to improve efficiency Design for Efficiency From the Start Identify key efficiency requirements up front Design for these requirements during all phases Combine These Two Approaches Make trade-offs for efficiency requirements during design Address remaining efficiency issues after initial design

Trade-off between Principles Flexibility Reusability Efficiency Trade-off between Principles 18/24 Speed efficiency Real-time applications are the most demanding in terms of speed Profiler--- an application that tracks resource usage during program execution

Impediments to Speed Efficiency Flexibility Reusability Efficiency Trade-off between Principles 19/24 Impediments to Speed Efficiency Loops while, for, do (think about sorting algorithms) Remote operations Requiring a network LAN The Internet Function calls -- if the function called results in the above Object creation

Trade-off between Principles Flexibility Reusability Efficiency Trade-off between Principles 20/24 Trade-off Between Number of Remote Calls and Volume Retrieved at Each Call Volume retrieved at each access Typical target Number of remote accesses

Attaining Storage Efficiency Flexibility Reusability Efficiency Trade-off between Principles 21/24 Attaining Storage Efficiency Store only the data needed Trades off storage efficiency vs. time to extract and re-integrate Compress the data Trades off storage efficiency vs. time to compress and decompress Store in order of relative frequency Trades off storage efficiency vs. time to determine location

Trading off Robustness, Flexibility, Efficiency and Reusability Trade-off between Principles 22/24 Trading off Robustness, Flexibility, Efficiency and Reusability I think you forgot to mention “Correctness” 1A. Extreme Programming Approach Design for sufficiency only 1B. Flexibility-driven Approach Design for extensive future requirements Reuse usually a by-product 2. Ensure robustness 3. Provide enough efficiency Compromise re-use etc. as necessary to attain efficiency requirements - or -

A More Flexible Design for Calculator Application Flexibility Reusability Efficiency Trade-off between Principles 23/24 A More Flexible Design for Calculator Application Existing Design New Design Calculator solicitNumAccounts() CalcDisplay display() CommandLineCalculator main() executeAdditions() solicitNumberAccounts() getAnInputFromUser() interactWithUser() CalcOperation execute() Add Multiply Divide

Summary of This Chapter Flexibility Reusability Efficiency Trade-off between Principles 24/24 Summary of This Chapter Flexibility == readily changeable We design flexibly, introducing parts, because change and reuse are likely. Reusability in other applications Efficiency in time in space (These add to Correctness & Robustness, covered in chapter 4)