By Justin Hendrix. Design Challenges Design is the activity that links requirements to coding and debugging. Good design is useful on small project and.

Slides:



Advertisements
Similar presentations
Chapter 4 Computation Bjarne Stroustrup
Advertisements

Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation For C# Developers.
Software Engineering Key design concepts Design heuristics Design practices.
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Chapter 13 Design Concepts and Principles
High Quality Code Why it matters. By Ryan Ruzich.
Communicating in Code: Layout and Style Programming Studio Spring 2009 Note: several examples in this lecture taken from The Practice of Programming by.
High Quality Code – Style Matters  Chapter 5. Design in Construction  Chapter 31. Layout and Style Software Construction by Jeff Nogy.
Software Engineering and Design Principles Chapter 1.
Class 0: Review and Perspective. cis 335 Fall 2001 Barry Cohen Class info n Barry Cohen n n Office hours: W 3:15-4:40.
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
Chapter 1 Principles of Programming and Software Engineering.
The Software Design Process CPSC 315 – Programming Studio Fall 2009.
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.
Computer Science 240 Principles of Software Design.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 system design 1 what is systems design? preparation of the system’s specifications with.
The Software Development Life Cycle: An Overview
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Design-Making Projects Work (Chapter7) n Large Projects u Design often distinct from analysis or coding u Project takes weeks, months or years to create.
Object Oriented Programming Key Features of OO Approach Data encapsulation –data and methods are contained in a single unit, object –promotes internal.
“Enhancing Reuse with Information Hiding” ITT Proceedings of the Workshop on Reusability in Programming, 1983 Reprinted in Software Reusability, Volume.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
University of Toronto Department of Computer Science CSC444 Lec05- 1 Lecture 5: Decomposition and Abstraction Decomposition When to decompose Identifying.
 2004 by SEC Chapter 4 Software Design. 2  2004 by SEC Chapter 4 Software Design 4.1 Design Fundamentals 4.2 Design Method 4.3 Architecture Design
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
Modularity Lecture 4 Course Name: High Level Programming Language Year : 2010.
THE SOFTWARE DESIGN PROCESS CSCE 315 – Programming Studio Spring 2010.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
Software Development. Software Developers Refresher A person or organization that designs software and writes the programs. Software development is the.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
The Way to Produce Good, Clean Code That Will Blow Your Boss Away!
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
CS242.  Reduce Complexity  Introduce an intermediate, understandable abstraction  Avoid code duplication  Support subclassing  Hide sequences  Hide.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Java Fundamentals Usman Ependi UBD
Revealing the Secrets of Self-Documenting Code Svetlin Nakov Telerik Corporation
Program Style Chapter 22 IB103 Week 12 (part 2). Modularity: the ability to reuse code Encapsulation: hide data access directly but may use methods (the.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 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.
Chapter 7 Implementation. Implementation Approaches F Big bang –Code entire system and test in an unstructured manner F Top-down –Start by implementing.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Design. Practices Principles Patterns What are the characteristics of good design? What are good solutions to common design problems? How do we go about.
High Quality Code – Style Matters  Design in Construction  Layout and Style Software Construction by Jeff Nogy.
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.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
CSCE 240 – Intro to Software Engineering Lecture 3.
Principles of Programming & Software Engineering
Design in Construction
Chapter 1: Software design
Principles of Programming and Software Engineering
About the Presentations
Chapter 5 Design in Construction
The Software Design Process
PROGRAMMING METHODOLOGY
Class Diagrams.
Producing Production Quality Software
Focus of the Course Object-Oriented Software Development
Presentation transcript:

By Justin Hendrix

Design Challenges Design is the activity that links requirements to coding and debugging. Good design is useful on small project and indispensable o large ones. A “Wicked” problem is one that could be clearly defined only by solving it. Design is a Sloppy Process Design is About Tradeoffs and Priorities Design Involves Restrictions Design is Nondeterministic (Forever) Design is a Heuristic Process Design is Emergent (Evolve)

Key Design Concepts Good design depends on understanding a handful of key concepts. Desirable Characteristics of Design Minimal complexity Ease of maintenance Loose coupling Extensibility Reusability High fan-in (make good use of utility classes) Low-to-medium fan-out (class use low-to-medium number of other classes) Portability Leanness Stratification Standard techniques

Key Design Concepts Levels of Design Software System Division into subsystems/packages Division into classes within packages Division into data and routines within classes Internal routine design

Design Building Blocks: Heuristics Find Real-World Objects Identify the objects and their attributes Determine what can be done to each object. Determine what each object is allowed to do to other objects. Determine the parts of each object that will be visible to other objects—which parts will be public and which will be private Define each object’s public interface. Abstraction – Referring to an object and not its parts Inherit – When inheritance Simplifies the Design

Design Building Blocks: Heuristics Hide Secrets (Information Hiding) Two Categories of Secrets Hiding complexity so that your brain doesn't have to deal with it unless you’re specifically concerned with it Hiding sources of change so that when change occurs, the effects are localized Barriers to Information Hiding Excessive distribution of information Circular dependencies Class data mistaken for global data Perceived performance penalties Value of Information Hiding It adds to the quality of the object-oriented code.

Design Building Blocks: Heuristics Identify Areas Likely to Change Business rules Hardware dependencies Input and output Nonstandard language features Difficult design and construction areas Status variables Other heuristics Aim for Strong Cohesion Build Hierarchies Formalize Class Contracts Assign Responsibilities Design for Test Avoid Failure Choose Binding Time Consciously Make Central Points of Control Consider Using Brute Force Draw a Diagram Keep you Design Modular

Design Practices Design Practice – steps you can take that often produce good results. Iterate Design is an iterative process. You don’t’t usally go from point A only to point B; you go from point A to point B and back to point A. Divide and Conquer Top-Down and Bottom-Up Design Approaches Experimental Prototyping Collaborative Design How Much Design is Enough?

Layout and Style The Fundamental Theorem of Formatting says that good visual layout shows the logical structure of the program. Making the code look pretty is worth something, but it’s worth less than showing the code’s structure. Details of a specific method of structuring a program are much less important that the fact that the program is structured consistently.

Layout and Style Objectives of Good Layout Accurately represent the logical structure of the code Consistently represent the logical structure of the code Improve readability Withstand modifications White Space Grouping Blank lines Indentation

Layout Styles Pure Blocks – { | } or if | end if !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! Endline Layout !!!!!! (!!!!!!!!!!!!!!!!!!!!!!!!) !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! Rare VB style If ( soldCount > 1000 ) Then mardown =.10 profit =.05 Else markdown =.05 End If

Control-Structure Blocks If ( expression ) One-statement; If (expression ) { One-statement; } If (expression ) { One-statement; } If (expression ) one-statement;

Control-Structure Blocks If (((‘0’ <= inChar) && (inChar <= ‘9’)) || ((‘a’ <= inChar) && (inChar <= ‘z’)) || ((‘A’ <= inChar) && (inChar <=‘Z’))) If ( ( ( ‘0’ <= inChar ) && ( inChar <= ‘9’ ) ) || ( ( ‘a’ <= inChar ) && ( inChar <= ‘z’ ) ) || ( ( ‘A’ <= inChar ) && ( inChar <=‘Z’ ) ) ) Avoid GoTo’s

Laying Out Individual Statements Statement Length – Lines longer that 80 character are hard to read. Using Spaces for Clarity While(pathName[startPaht+postion]<>’;’) Use only one statement per line – Avoid multi statement lines. Data Declarations Group the declarations with others of its kind. If reasonable, separate all declarations on their own lines. Declare variable close to where they’re first used. Pointers -> (EmployeeList *employees;)

Laying Out Comments

Laying Out Routines Public void InsertionSort( SortArray data, Int firstElement, Int lastElemnt )