Software Design Principles

Slides:



Advertisements
Similar presentations
Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation For C# Developers.
Advertisements

CHAPTER 1 SOFTWARE DEVELOPMENT. 2 Goals of software development Aspects of software quality Development life cycle models Basic concepts of algorithm.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
NJIT More GRASP Patterns Chapter 22 Applying UML and Patterns Craig Larman Prepared By: Krishnendu Banerjee.
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
CS350/550 Software Engineering Lecture 1. Class Work The main part of the class is a practical software engineering project, in teams of 3-5 people There.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
Software Engineering Principles and C++ Classes
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Computer Science 240 Principles of Software Design.
Chapter 25 More Design Patterns.
Introduction SWE 619. Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Modelling information systems
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.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Object Oriented Analysis and Design Introduction.
CS 350 – Software Design The Object Paradigm – Chapter 1 If you were tasked to write code to access a description of shapes that were stored in a database.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Computer Science 340 Software Design & Testing Design Principles Review.
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
Architectural Design Identifying system components and their interfaces.
Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Object Oriented.
Computer Science 340 Software Design & Testing Design Principles Review.
Facade Introduction. Intent Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
CS251 – Software Engineering Lecture 9: Software Design Slides by Mohammad El-Ramly, PhD
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.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1.
Final Review. From ArrayLists to Arrays The ArrayList : used to organize a list of objects –It is a class in the Java API –the ArrayList class uses an.
Informatics 122 Software Design II Lecture 12 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
Chapter 10 Software quality. This chapter discusses n Some important properties we want our system to have, specifically correctness and maintainability.
CSCE 240 – Intro to Software Engineering Lecture 3.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
Presented by FACADE PATTERN
7. Modular and structured design
CS240: Advanced Programming Concepts
Chapter 7 Object-Oriented Programming
MPCS – Advanced java Programming
Data Abstraction: The Walls
CS240: Advanced Programming Concepts
About the Presentations
Problem Solving Techniques
Objects First with Java
Object oriented vs procedural programming
Chapter 1 Introduction(1.1)
Software Design Lecture : 8
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Algorithms and Problem Solving
Authors: Barry Smyth, Mark T. Keane, Padraig Cunningham
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
Software Design Lecture : 6
Presentation transcript:

Software Design Principles CS 240 – Advanced Programming Concepts

Goals of Software Design Create systems that: Work Are easy to understand, debug, and maintain Hold up well under changes Have reusable components

Design is Inherently Iterative Design, implement, test, Design, implement, test, … Feedback loop from implementation back into design provides valuable knowledge Designing everything before beginning implementation doesn’t work Beginning implementation without doing any design also doesn’t work The appropriate balance is achieved by interleaving design and implementation activities in relatively short iterations

Abstraction Abstraction is one of the software designer’s primary tools for coping with COMPLEXITY Programming languages and OSes provide abstractions that model the underlying machine Programs written solely in terms of these low-level abstractions are very difficult to understand Software designers must create higher-level, domain-specific abstractions, and write their software in terms of those High-level abstractions implemented in terms of low-level abstractions

Abstraction Some abstractions correspond to “real world” concepts in the application domain Examples: Bank, Customer, Account, Loan, Broker, … Other abstractions do not correspond to “real world” domain concepts, but are needed for internal implementation Examples: HttpServer, Database, HashTable, …

Abstraction Each abstraction is represented as a class Each class has a carefully designed public interface that defines how the rest of the system interacts with it A client can invoke operations on an object without understanding how it works internally This is a powerful technique for reducing the cognitive burden of building complex systems

Naming A central part of abstraction is giving things names (or identifiers) Selecting good names for things is critical Class, method, and variable names should clearly convey their function or purpose Class and variable names are usually nouns Method names are usually verbs

Cohesion / Single Responsibility Each abstraction should have a single responsibility Each class should represent one, well-defined concept All operations on a class are highly related to the class’ concept Each method should perform one, well-defined task Unrelated or loosely related tasks should be in different methods Cohesive classes and methods are easy to name

Decomposition In addition to Abstraction, Decomposition is the other fundamental technique for taming COMPLEXITY Large problems subdivided into smaller sub-problems Subdivision continues until leaf-level problems are simple enough to solve directly Solutions to sub-problems are recombined into solutions to larger problems

Decomposition Decomposition is strongly related to Abstraction The solution to each sub-problem is encapsulated in its own abstraction (class or subroutine) Solutions to larger problems are concise because they’re expressed in terms of sub-problem solutions, the details of which can be ignored The decomposition process helps us discover (or invent) the abstractions that we need

Decomposition Levels of decomposition System Subsystem Packages Classes Methods

Algorithm & Data Structure Selection No amount of decomposition or abstraction will hide a fundamentally flawed selection of algorithm or data structure. Examples: Trie data structure for SpellingCorrector Map with pattern keys for EvilHangman

Separation of Interface and Implementation Maintain a strict separation between a class’ interface and its implementation This allows internal details to change without affecting clients Program to interfaces instead of concrete classes

Information Hiding Many languages provide “public”, “private”, and “protected” access levels All internal implementation is “private” unless there’s a good reason to make it “protected” or “public” A class’ public interface should be as simple as possible

Information Hiding Don’t let internal details “leak out” of a class ClassRoll instead of StudentLinkedList Some classes or methods are inherently tied to a particular implementation. For these it is OK to use an implementation-specific name HashTable TreeSet

Code Duplication The DRY principle: Don’t repeat yourself Code duplication should be strenuously avoided Identical or similar sections of code Disadvantages of duplication: N copies to maintain Bugs are duplicated N times Makes program longer, decreasing maintainability Solutions Factor common code into a separate method or class Shared code might be placed in a common superclass