CS240: Advanced Programming Concepts

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.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
PROCESS MODELING Transform Description. A model is a representation of reality. Just as a picture is worth a thousand words, most models are pictorial.
Department of Computer Science University of Maryland, College Park
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
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.
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Computer Science 240 Principles of Software Design.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Introduction SWE 619. Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software.
Introduction To System Analysis and design
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Python Mini-Course University of Oklahoma Department of Psychology Day 2 – Lesson 6 Program Design 4/18/09 Python Mini-Course: Day 2 - Lesson 6 1.
Computer Science 340 Software Design & Testing Design Principles Review.
Computer Science 240 © Ken Rodham 2006 Principles of Software Design.
Object Oriented Design Jerry KotubaSYST Object Oriented Methodologies1.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
1 Some initial Design suggestions… Getting started… where to begin? Find out whether your design architecture will work… as soon as possible. If you need.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
Computer Science 340 Software Design & Testing Design Principles Review.
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.
Software Design Process
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Design Reuse Earlier we have covered the re-usable Architectural Styles as design patterns for High-Level Design. At mid-level and low-level, design patterns.
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 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
CSE 2341 Object Oriented Programming with C++ Note Set #4
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,
Object Oriented Systems Design
Chapter 2 Object-Oriented Paradigm Overview
CSC 222: Object-Oriented Programming
CSC 222: Object-Oriented Programming
7. Modular and structured design
CSC 222: Computer Programming II
Software Engineering Lecture 4 System Modeling The Analysis Stage.
The Object-Oriented Thought Process Chapter 1
CSC 221: Computer Programming I Fall 2005
Data Abstraction: The Walls
Chapter 1 Data Abstraction: The Walls
Principles of Programming and Software Engineering
CS240: Advanced Programming Concepts
CSC 222: Object-Oriented Programming
Part 3 Design What does design mean in different fields?
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
CSCI1600: Embedded and Real Time Software
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Object oriented vs procedural programming
Software Architecture
Chapter 1 Introduction(1.1)
Software Design Lecture : 9.
CSCI1600: Embedded and Real Time Software
Global Challenge Walking for Water Lesson 2.
Algorithms and Problem Solving
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Software Design Principles
Global Challenge Walking for Water Lesson 2.
Applying Use Cases (Chapters 25,26)
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Global Challenge Walking for Water Lesson 2.
Presentation transcript:

CS240: Advanced Programming Concepts Week 6 Tuesday

Goals of Software Design Create systems that Work Easy as possible 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 Exceptions Object properties (ID, Name, Parent, etc.) Event handlers (MouseMoved, UserLoggedIn)

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

Abstracting All the Way Some abstractions are simple enough to store directly using the language’s built-in data types Name => string Pay Grade => int Credit Card => string Often it is best to create classes for such simple abstractions for the following reasons: Data validation Related operations Code readability

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