Software Design 1.1 CPS 108, Spring 2004 l Software Design and Implementation  Object oriented programming and design Language independent concepts including.

Slides:



Advertisements
Similar presentations
ITEC200 – Week03 Inheritance and Class Hierarchies.
Advertisements

Software Engineering and Design Principles Chapter 1.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Fall 2007CS 2251 Inheritance and Class Hierarchies Chapter 3.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Reasons to study concepts of PL
Object Oriented Programming.  OOP Basic Principles  C++ Classes  September 2004  John Edgar 22.
CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
CSE 332: C++ Classes From Procedural to Object-oriented Programming Procedural programming –Functions have been the main focus so far Function parameters.
CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.
13 Jul 2006CSE403, Summer'06, Lecture10 Lifecycle Architecture Review: Preliminary Feedback Valentin Razmov.
CPS 108 : Spring What is Computer Science? What is it that distinguishes it from the separate subjects with which it is related? What is the linking.
OOP Languages: Java vs C++
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Programming Languages and Paradigms Object-Oriented Programming.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
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.
CIT241 Prerequisite Knowledge ◦ Variables ◦ Operators ◦ C++ Syntax ◦ Program Structure ◦ Classes  Basic Structure of a class  Concept of Data Hiding.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
CSCA48 Course Summary.
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.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Course Overview & Topics CSc 335: Object-Oriented Programming and Design © Rick Mercer 1.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
Week 14 - Monday.  What did we talk about last time?  Introduction to C++  Input and output  Functions  Overloadable  Default parameters  Pass.
Java Objects and Classes. Overview n Creating objects that belong to the classes in the standard Java library n Creating your own classes.
1-1 C Sc 335 Course Overview Object-Oriented Programming and Design Rick Mercer.
1 CSC 222: Object-Oriented Programming Spring 2013 Course goals:  To know and use basic Java programming constructs for object- oriented problem solving.
Software Design 1.1 Tapestry classes -> STL l What’s the difference between tvector and vector  Safety and the kitchen sink What happens with t[21] on.
Software Design 8.1 A Rose by any other name…C or Java? l Why do we use Java in our courses (royal we?)  Object oriented  Large collection of libraries.
Software Design 8.1 Compsci 108 l Object oriented design and programming of medium-sized projects in groups using modern tools and practices in meaningful.
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
C++ and Ubuntu Linux Review and Practice CS 244 Brent M. Dingle, Ph.D. Game Design and Development Program Department of Mathematics, Statistics, and.
Software Design 18.1 CPS 108 l Object oriented design and programming of medium-sized projects in groups using modern tools and practices in meaningful.
CS3100 Software Project Management Agile Approaches.
Software Design 14.1 CPS 108 l Object oriented design and programming of medium-sized projects in groups using modern tools and practices in meaningful.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
CPS Inheritance and the Yahtzee program l In version of Yahtzee given previously, scorecard.h held information about every score-card entry, e.g.,
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
CS-1030 Dr. Mark L. Hornick 1 Basic C++ State the difference between a function/class declaration and a function/class definition. Explain the purpose.
Software Design 1.1 CPS 108, Spring 2006 l Object oriented programming and design, we'll use Java and C++  Language independent concepts including design.
PC204 Lecture 5 Programming Methodologies Copyright 2000 by Conrad Huang and the Regents of the University of California. All rights reserved.
EXtreme Programming and Open Source engineering paradigm A comparison
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Object-Oriented Design Concepts University of Sunderland.
Duke CPS CPS 108, Spring 1998 l Software Design and Implementation ä Object oriented programming and design ä good design helps do away with late.
Duke CPS Programming Heuristics l Identify the aspects of your application that vary and separate them from what stays the same ä Take what varies.
CPS Searching, Maps, Tables (hashing) l Searching is a fundamentally important operation  We want to search quickly, very very quickly  Consider.
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2005.
CSC 222: Object-Oriented Programming
CSC 222: Object-Oriented Programming
Copyright © Jim Fawcett Spring 2017
CSC 222: Computer Programming II
Jim Fawcett CSE687 – Object Oriented Design Spring 2016
CSE687 - Object Oriented Design class notes Survey of the C++ Programming Language Jim Fawcett Spring 2004.
CSC 222: Object-Oriented Programming
Object-Orientated Programming
object oriented Principles of software design
Object Oriented Practices
Frameworks And Patterns
Standard Template Library
Linked lists Low-level (concrete) data structure, used to implement higher-level structures Used to implement sequences/lists (see CList in Tapestry) Basis.
Programming in the small, medium, large
Jim Fawcett CSE687 – Object Oriented Design Spring 2015
Presentation transcript:

Software Design 1.1 CPS 108, Spring 2004 l Software Design and Implementation  Object oriented programming and design Language independent concepts including design patterns, e.g., Model-View-Controller, iterator, factory, bridge, … Design independent concepts, e.g., coupling, cohesion, testing, refactoring, profiling, … l What’s in the course?  C++ and Java, team projects, mastery exams team projects can be more and less than the sum of their parts  high-level abstractions, low-level details patterns, heuristics, and idioms

Software Design 1.2 Application Programming Interface, API l Standard C++ headers, STL headers  Curses  wxWindows l Java API  java.util, javax.swing, java.net, javax.crypto, …  Eclipse SWT l Google API l Gracenote API

Software Design 1.3 Program Design and Implementation l Language independent principles of design and programming  design heuristics coupling, cohesion, small functions, small interfaces...  design patterns factories, adapter, MVC, decorator, iterator, … l Language specific:  Idioms smart pointers, vectors/arrays, overloaded operators...  idiosyncracies, idiocies must define virtual destructor, stream zoo in Java,...

Software Design 1.4 Administrivia l check website and bulletin board regularly   See links to bulletin board and other stuff l Grading (see web pages)  group projects: small, medium, large  mastery programs (solo or semi-solo endeavors)  readings and summaries  tests l Evaluating team projects, role of TA, UTA, consultants  face-to-face evaluation, early feedback l Compiling, tools, environments, Linux, Windows, Mac  g++ 3.3, Java 2 aka 1.4, JRE, …

Software Design 1.5 wordlines.cpp, understanding code typedef map > linemap; while (getline(input,line)) { linecount++; istringstream iline(line); while (iline >> w) { linemap::iterator it = info.find(w); if (it == info.end()) { set si; si.insert(linecount); info.insert(make_pair(w,si)); } else { it->second.insert(linecount); }

Software Design 1.6 Questions about wordlines.cpp l Conceptually, what's a map and what's a set? l In terms of implementation how do they work? l What's an iterator (abstractly and concretely) l What are streams? ifstream, cin/cout, istring/ostring, … l What's a templated class? l Other questions?

Software Design 1.7 Classes: Review/Overview l A class encapsulates state and behavior  Behavior first when designing a class  Information hiding: who knows state/behavior? l State is private/protected; some behavior is public  Private/protected helper functions  A class is called an object factory, creates lots of instances l Classes communicate and collaborate  Parameters: send and receive  Containment: has a reference to  Inheritance: is-a

Software Design 1.8 C++ (and Java) class construction l C++ uses.h and.cpp, Java uses.java  Documentation different (javadoc vs. ???) l Default ctor, copy constructor, destructor, assignment operator  tvector, string, Date  Copy constructor needed to avoid shallow copy  In C++ destructors needed to free resources/self, Java?  Clone makes copy in Java (rare), share is default l Private, protected, public, (package)  Private default in C++, package default in Java  Per method declaration in Java, class sections in C++

Software Design 1.9 Design Criteria Good design comes from experience, experience comes from bad design Fred Brooks (or Henry Petroski) l Design with goals:  ease of use  portability  ease of re-use  efficiency  first to market  ?????

Software Design 1.10 How to code l Coding/Implementation goals:  Make it run  Make it right  Make it fast  Make it small l spiral design (or RAD or !waterfall or...)  what’s the design methodology? specification design implementation

Software Design 1.11 XP and Refactoring (See books by Kent Beck (XP) and Martin Fowler (refactoring)) l eXtreme Programming (XP) is an agile design process  Communication: unit tests, pair programming, estimation  Simplicity: what is the simplest approach that works?  Feedback: system and clients; programs and stories  Courage: throw code away, dare to be great/different l Refactoring  Change internal structure without changing observable behavior  Don’t worry (too much) about upfront design  Simplicity over flexibility (see XP)

Software Design 1.12 Modules, design, coding, refactor, XP l Make it run, make it right, make it fast, make it small l Do the simplest thing that can possibly work (XP)  Design so that refactoring is possible  Don’t lose sight of where you’re going, keep change in mind, but not as the driving force [it will evolve] l Refactor: functionality doesn’t change, code does  Should mean that new tests aren’t written, just re-run  Depends on modularity of code, testing in pieces l What’s a module in C++  Could be a class, a file, a directory, a library, a namespace  We should, at least, use classes, files, directories

Software Design 1.13 Design Heuristics: class/program/function (see text by Arthur Riel) l Coupling  classes/modules are independent of each other  goal: minimal, loose coupling  do classes collaborate and/or communicate? l Cohesion  classes/modules capture one abstraction/model  keep things as simple as possible, but no simpler  goal: strong cohesion (avoid kitchen sink) l The open/closed principle  classes/programs: open to extensibility, closed to modification

Software Design 1.14 C++ idioms/general concepts l Genericity  Templates, STL, containers, algorithms l Copy/Assignment/Memory  Deep copy model, memory management “required” l Low-level structures  C-style arrays and strings compared to STL, Tapestry l const  Good for clients, bad for designers/coders? l From C to C++ to Java  function pointers, function objects, inheritance

Software Design 1.15 Standard Libraries l In C++ there is the Standard Library, formerly known as the Standard Template Library or STL  Emphasizes generic programming (using templates)  Write a sorting routine, the implementation depends on Elements being comparable Elements being assignable We should be able to write a routine not specific to int, string or any other type, but to a generic type that supports being comparable/assignable l In C++ a templated function/class is a code-factory, generates code specific to a type at compile time  Arguably hard to use and unsafe

Software Design 1.16 Eric Raymond l Open source evangelist  The Cathedral and the Bazaar  How to construct software “Good programmers know what to write. Great ones know what to rewrite (and reuse).” l How to convince someone that guns are a good idea? Put this sign up: l THIS HOME IS A GUN-FREE ZONE