PRINCIPLES OF GOOD DESIGN 12/7/2015 1. Assignment 4 – Deadline 28 Nov.  Read an article placed in generalshare course folder  Point: Design Patterns.

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Object-Oriented Software Construction Bertrand Meyer 2nd ed., Prentice Hall, 1997.
Chapter 13 Design Concepts and Principles
High Quality Code Why it matters. By Ryan Ruzich.
Software Engineering Software Design Slide 1 Software Engineering Software Design.
Software Design Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:
Component-Level Design
The Architecture Design Process
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Chapter 1 Principles of Programming and Software Engineering.
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.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Software Engineering CSE470: Systems Engineering 35 Computer System Engineering Computer System Engineering is a problem-solving activity. Itemize desired.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
Chapter 22 Object-Oriented Design
Course Instructor: Aisha Azeem
System Design Decomposing the System. Sequence diagram changes UML 2.x specifications tells that Sequence diagrams now support if-conditions, loops and.
C++ fundamentals.
MADALINA CROITORU Software Engineering week 4 Madalina Croitoru IUT Montpellier.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Introduction to Object-oriented programming and software development Lecture 1.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
CSE 303 – Software Design and Architecture
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
SOFTWARE DESIGN.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
CSE 219 Computer Science III Program Design Principles.
Software Engineering Principles Principles form the basis of methods, techniques, methodologies and tools Principles form the basis of methods, techniques,
SE: CHAPTER 7 Writing The Program
Architectural Design Identifying system components and their interfaces.
Chapter 6 Architectural Design.
CSE 303 – Software Design and Architecture LECTURE 4.
Design Concepts and Principles Instructor: Dr. Jerry Gao.
GRASP: Designing Objects with Responsibilities
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Software Design Mihaela Dinsoreanu, PhD Contact: room D01, Baritiu Spring 2011 Computer Science Department,
Introduction to Design. What is Design? 2 minutes Pairs.
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.
Thanks for Coming l WEB. Principles of Good Design SEI, SJTU WEB APPS and SERVICES.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Or how to work smarter when building solutions.  2:30 – 3:30 Mondays – focus on problem solving (with some terminology thrown in upon occasion)  All.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
Object-Oriented Design Concepts University of Sunderland.
Design CS 470 – Software Engineering I Sheldon X. Liang, PH.D.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
Why is Design so Difficult? Analysis: Focuses on the application domain Design: Focuses on the solution domain –The solution domain is changing very rapidly.
Principles of Programming & Software Engineering
Software Design.
Lecture 9- Design Concepts and Principles
For University Use Only
Object-Oriented Design
Lecture 9- Design Concepts and Principles
Principles of Good Design
Chapter 5 Architectural Design.
Principles of Good Design
Software Engineering Software Design.
Presentation transcript:

PRINCIPLES OF GOOD DESIGN 12/7/2015 1

Assignment 4 – Deadline 28 Nov.  Read an article placed in generalshare course folder  Point: Design Patterns Are Bad for Software Design  Counter Point: Every Good Designer Uses Patterns  Write a single page summary that includes following:  Points (with bullets/numbering)  Counter points (with bullets/numbering)  Conclusion  Submit 1 page printed: Font size 12, Times new roman (not more than 30 lines) 2

From Journeyman to Master 3 Pieces, Moves Criteria, Principles, Heuristics Contextual Solutions What is Good? How to Apply "Good"? How to Play?

Stages of Learning 4  Learn the Rules!  algorithms, data structures and languages of software  write programs, although not always good ones  Learn the Principles!  software design, programming paradigms with pros and cons  importance of cohesion, coupling, information hiding, dependency management  Learn the Patterns!  study the "design of masters"  Understand! Memorize! Apply!

Where Do We Stand ? 5  We know the Rules  1-2 OO programming language (Java, C++)  Some experience in writing programs (< 10 KLOC)  We heard about Principles  Open-Closed (Inheritance) & Liskov Substitution Principle (Polymorphism)  Randomly applied some of them  We dream of becoming "design masters" but...  …we believe that writing good software is somehow "magic"  exclusively tailored for geniuses, "artists", gurus ;-)

A Roadmap  What is Good Design?  Goals of Design  Key Concepts and Principles  Criteria for Good Design  Principles and Rules of Good Design  How to Apply Good Design?  Design Patterns  Architectural Patterns (Styles) 12/7/20156

Goals of Design 7  Decompose system into components  i.e. identify the software architecture  Describe component functionality  informally or formally  Determine relationships between components  identify component dependencies  determine inter-component communication mechanisms  Specify component interfaces  Interfaces should be well defined facilitates component testing and team communication

What is Good Design? 8  The temptation of "correct design"  insurance against "design catastrophes"  design methods that guarantee the "correct design"  Need of criteria for evaluating a design  Need of principles and rules for creating good designs A good design is one that balances trade-offs to minimize the total cost of the system over its entire lifetime […] a matter of avoiding those characteristics that lead to bad consequences. Coad & Jourdon There is no correct design! You must decide!

Key Design Issues 9 1.Decomposition/Composition  Why and How ?  What is a component?  Principles Main purpose - Manage software system complexity by improving software quality factors... facilitate systematic reuse 2. Modularity  Definition. Benefits  Criteria  Principles

Decomposition Select a piece of the problem  initially, the whole problem 2. Determine the components in this piece using a design paradigm  e.g. functional, structured, object-oriented, generic, etc. 3. Describe the components interactions 4. Repeat steps 1 through 3 until some termination criteria is met  e.g., customer is satisfied, run out of money, etc. ;-) WHY ? Handle complexity by splitting large problems into smaller problems, i.e. "divide and conquer" methodology

Modularity 11  A modular system is one that's structured into identifiable abstractions called components  Components should possess well-specified abstract interfaces  Components should have high cohesion and low coupling A software construction method is modular if it helps designers produce software systems made of autonomous elements connected by a coherent, simple structure. B. Meyer

Benefits of Modularity 12 Modularity facilitates software quality factors, e.g.:  Extensibility well-defined, abstract interfaces  Reusability low-coupling, high-cohesion  Portability hide machine dependencies

Meyer's Five Criteria for Evaluating Modularity 13  Decomposability  Are larger components decomposed into smaller components?  Composability  Are larger components composed from smaller components?  Understandability  Are components separately understandable?  Continuity  Do small changes to the specification affect a localized and limited number of components?  Protection  Are the effects of run-time abnormalities confined to a small number of related components?

1. Decomposability  Ability to decompose a large problem into sub-problems  Decompose problem into smaller sub-problems that can be solved separately  Goal: Division of Labor keep dependencies explicit and minimal  Example: Top-Down Design 14

2. Composability  Degree to which modules once designed and built can be reused to create other systems  Freely combine modules to produce new systems  Reusability in different environments  components  Example: Math libraries; UNIX command 15

3. Understandability  Ease of understanding the program components by themselves, i.e. without refering to other components  Individual modules understandable by human reader 16

4. Continuity  Ability to make incremental changes  Small change in requirements results in:  changes in only a few modules  does not affect the architecture  Example: Symbolic Constants 17

5. Protection  A characteristic that reduces the propagation of side effects of an error in one module  Effects of an abnormal run-time condition is confined to a few modules  Example: Validating input at source 18

Meyer's Five Rules of Modularity 19  Direct Mapping  Modular structure of the software system should be compatible with modular structure devised in the process of modeling the problem domain consistent relation between problem model and solution structure  Few Interfaces  Minimum number of interfaces between modules Every component should communicate with as few others as possible  Small Interfaces  Minimum amount of information should move across an interface If any two components communicate at all, they should exchange as little information as possible

Meyer's Five Rules of Modularity 20  Explicit Interfaces  Interfaces should be explicit. Whenever two components A and B communicate, this must be obvious from the text of A or B or both Communication through global variables violates this criterion  Information Hiding

1. Direct Mapping 21  Keep the structure of the solution compatible with the structure of the modeled problem domain  clear mapping (correspondence) between the two Impact on:  Continuity  easier to assess and limit the impact of change  Decomposability  decomposition in the problem domain model as a good starting point for the decomposition of the software

2. Few Interfaces 22  Every module should communicate with as few others as possible  rather n-1 than n(n-1)/ 2  affects... YOU TELL ME … WHAT and WHY?  Continuity, Protection, Understandability, Composability anarchic centralized distributed

3. Small Interfaces 23  If two modules communicate, they should exchange as little information as possible  limited "bandwidth" of communication  Continuity and Protection 4. Explicit Interfaces  Whenever two modules A and B communicate, this must be obvious from the text of A or B or both.  Decomposability and Composability  Continuity, Understandability

4. Explicit Interfaces 24  The issue of indirect coupling  data sharing Module AModule B Data Item x modifies accesses

Rule 2 – Rule 3 – Rule 3 Rephrased 25  Few Interfaces: “Don’t talk to many!”  Small Interfaces: “Don’t talk a lot!”  Explicit Interfaces: “Talk loud and in public! Don’t whisper!”

5. Information Hiding 26 Motivation: design decisions that are subject to change should be hidden behind abstract interfaces, i.e. components  Components should communicate only through well-defined interfaces  Each component is specified by as little information as possible remember Schmidt’s decomposition principles!  Continuity: If internal details change, client components should be minimally affected  not even recompiling or linking Information hiding is one means to enhance abstraction!