Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency.

Slides:



Advertisements
Similar presentations
Chapter 6 Introduction to Design Patterns. Sample Design Goals and Ways to Accomplish Them Reusability, Flexibility, and Efficiency o Reuse flexible designs.
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Programming Paradigms and languages
Object-Oriented Software Development CS 3331 Fall 2009.
Presented by: Thabet Kacem Spring Outline Contributions Introduction Proposed Approach Related Work Reconception of ADLs XTEAM Tool Chain Discussion.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
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.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Chapter 6. 2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single Value Pass by Reference Variable Scope.
Software Testing and Quality Assurance: Introduction and Terminology
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.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
DATA STRUCTURE Subject Code -14B11CI211.
Introduction To System Analysis and design
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.
Chapter 2 Object Orientation. Process Phase Affected by This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed Design.
Prologue: The Software Process. Main Phases of Software Process 1. Requirements Analysis (answers “WHAT?”) Specifying what the application must do 2.
Lecture # 06 Design Principles II
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 
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Chapters 4&5 Design Principles: Correctness, Robustness, Flexibility, Reusability, and Efficiency.
Odyssey A Reuse Environment based on Domain Models Prepared By: Mahmud Gabareen Eliad Cohen.
SWE 316: Software Design and Architecture Objectives Lecture # 15 Behavioral Design Patterns SWE 316: Software Design and Architecture  To learn the behavioral.
SOFTWARE SYSTEMS DEVELOPMENT 4: System Design. Simplified view on software product development process 2 Product Planning System Design Project Planning.
Jan. 29, 2002Grand Challenges in Simulation Issues in Enhancing Model Reuse C. Michael Overstreet Richard E. Nance Osman Balci.
GoF Sections Design Problems and Design Patterns.
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.
Chapter 1: Introduction and History  Where does the operating system fit in a computing system?  What does the operating system achieve?  What are the.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Structural Design Patterns
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
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.
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.
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.
Written by Changhyun, SON Chapter 5. Introduction to Design Optimization - 1 PART II Design Optimization.
UML (Unified Modeling Language)
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Chapter 7 Creational Design Pattern. Process Phases Discussed in This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed.
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.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
COMP2110 Software Design in lecture 14 Patterns(1) /Detailed Design
Chapter 25: Architecture and Product Lines
TIM 58 Chapter 8: Class and Method Design
Object Oriented Design Patterns - Structural Patterns
Two Patterns in Adaptive, Distributed Real-Time, Embedded Middleware
Software Design Lecture : 9.
Object-Oriented Programming
An Introduction to Software Architecture
Presentation transcript:

Chapter 5 Design Principles II: Flexibility, Reusability, and Efficiency

Process Phase Affected by This Chapter Requirements Analysis Design Implementation ArchitectureFrameworkDetailed Design Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Aspects of Flexibility  … 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 o … changing functionality Example : allow overdrafts Anticipate … Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Registering Website Members WebSite register() Member 0..nmembers Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Registering Website Members Flexibly WebSite Member 0..n StandardMemberXMemberYMember members Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Adding Functionality to an Application: Alternative Situations Within the scope of … 1.… a list of related functions Example: add print to an air travel itinerary functions an existing base class Example: add “print road - and ship - to air itinerary ” neither Example: add “print itineraries for combinations of air, road and ship transportation” Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Adding Functionality When a Base Class Exists Trip printItinerary() StandardTrip printItinerary() SomeApplicationClass Method(s) call printItinerary() Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Adding Functionality Through a Base Class Trip printItinerary() SeaTrip printItinerary() SomeApplicationClass LandTrip printItinerary() StandardTrip printItinerary() Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Additional Type of Flexibiliy Flexibility Aspect: ability to …Described in … … create objects in variable configurations determined at runtime “Creational” design patterns – chapter xx … create variable trees of objects or other structures at runtime “Structural” design patterns – chapter xx … change, recombine, or otherwise capture the mutual behavior of a set of objects “Behavioral” design patterns – chapter xx … create and store a possibly complex object of a class. Component technology – chapter xx … configure objects of predefined complex classes – or sets of classes – so as to interact in many ways Component technology – chapter xx Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Key Concept:  Flexibility  We design flexibly, introducing parts, because change and reuse are likely. Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Making a Method Re-usable  Specify completely o Preconditions etc (see figure xx)  Avoid unnecessary coupling with the enclosing class o Make static if feasible o Include parameterization o i.e., make the method functional o But limit the number of parameters  Make the names expressive o Understandability promotes re-usability  Explain the algorithm o Re-users need to know how the algorithm works Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Making a Class Re-usable  Describe the class completely  Make the class name and functionality match a real world concept o See section xx  Define a useful abstraction o attain broad applicability  Reduce dependencies on other classes o Elevate dependencies in hierarchy alternatives Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Reducing Dependency Among Classes Customer Replace … Piano with … CustomerPianoPianoOrder Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Leveraging Inheritance, Aggregation and Dependency for the Re-use of Class Combinations Customer computeBill() RegularCustomer computeBill() Customer computeBill() Bill compute() Customer computeBill( Orders ) Orders value() (1) Leveraging inheritance (3) Leveraging dependency (2) Leveraging aggregation Customer computeBill() Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Basic Approaches to Time Efficiency  Design for Other Criteria, Then Consider Efficiency o Design for flexibility, reusability, … o At some point, identify inefficient places o Make targeted changes to improve efficiency  Design for Efficiency From the Start o Identify key efficiency requirements up front o Design for these requirements during all phases  Combine These Two Approaches o Make trade-offs for efficiency requirements during design o Address remaining efficiency issues after initial design Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Space-Time Trade-offs Space Time to process one item Typical target Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Space-Time-Development Trade-offs SpaceTime Convenience of Development Limiting acceptable value unacceptable values better than acceptable values Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Impediments to Speed Efficiency o Loops o while, for, do o Remote operations o Requiring a network o LAN o The Internet o Function calls o -- if the function called results in the above o Object creation Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Trade-off Between Number of Remote Calls and Volume Retrieved at Each Call Number of remote accesses Volume retrieved at each access Typical target Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Storage Locations Code base Runtime RAM Disk storage required at runtime Disk storage required between runtimes Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Attaining Storage Efficiency  Store only the data needed o Trades off storage efficiency vs. time to extract and re-integrate  Compress the data o Trades off storage efficiency vs. time to compress and decompress  Store in order of relative frequency o Trades off storage efficiency vs. time to determine location Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Trading off Robustness, Flexibility, Efficiency and Reusability 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 - Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Extreme vs. non-Extreme + Job done faster (usually) + Scope clear + More likely to be efficient Future applications less likely to use the work - Refactoring for expanded requirements can be expensive + Future applications more likely to use parts + Accommodates changes in requirements Scope less clear - Potential to waste effort - Efficiency requires more special attention Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

A More Flexible Design for Calculator Application CommandLineCalculator main() executeAdditions() solicitNumberAccounts() getAnInputFromUser() interactWithUser() Existing Design New Design Calculator solicitNumAccounts() CalcDisplay display() CalcOperation execute() AddMultiplyDivide Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Summary of This Chapter  Flexibility o == readily changeable  Reusability o in other applications  Efficiency o in time o in space (These add to Correctness & Robustness, covered in chapter xx) Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.