CS240: Advanced Programming Concepts

Slides:



Advertisements
Similar presentations
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
Advertisements

General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Inheritance Inheritance Reserved word protected Reserved word super
1 Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L 8.1 – 8.5.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
Design Pattern Course Builder Pattern 1 Mahdieh Monzavi AmirKabir University of Technology, Department of Computer Engineering & Information Technology.
Object-oriented Programming Concepts
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
Program Design Divide and Conquer –Divide the program into separate tasks Functional Decomposition Top-Down Design –Divide an overall problem into discrete.
1 Working with Classes Chapter 6. 2 Class definition A class is a collection of data and routines that share a well-defined responsibility or provide.
Façade Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Algorithm Programming Coding Advices Bar-Ilan University תשס " ו by Moshe Fresko.
Computer Science 240 Principles of Software Design.
Design Patterns Ric Holt & Sarah Nadi U Waterloo, March 2010.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Software Engineering CS B Prof. George Heineman.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
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.
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
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.
Object-Oriented Modeling and Design
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.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
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.
The Strategy Pattern SE-2811 Dr. Mark L. Hornick 1 Class 1-2.
Lecture 12 March 16, The Scope of a Variable What if there are two variables with the same name? –A local or block-local variable can have the same.
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
Views of Data Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes,
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Object-Oriented Programming Chapter Chapter
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.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
More Design Patterns From: Shalloway & Trott, Design Patterns Explained, 2 nd ed.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
1 CS Programming Languages Class 22 November 14, 2000.
Object-Oriented Design Concepts University of Sunderland.
Chapter Eight Expanding Our Horizons Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering.
Design Patterns Creational Patterns. Abstract the instantiation process Help make the system independent of how its objects are created, composed and.
CSC 243 – Java Programming, Spring, 2014 Week 4, Interfaces, Derived Classes, and Abstract Classes.
CSCE 240 – Intro to Software Engineering Lecture 3.
CSC 243 – Java Programming, Fall, 2008 Tuesday, September 30, end of week 5, Interfaces, Derived Classes, and Abstract Classes.
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
MIS Professor Sandvig MIS 324 Professor Sandvig
Presented by FACADE PATTERN
Programming paradigms
CS240: Advanced Programming Concepts
Chapter 7 Object-Oriented Programming
By SmartBoard team Adapter pattern.
Chapter 11 Object-Oriented Design
Data Abstraction: The Walls
CS230 Tutorial Week 3.
11.1 The Concept of Abstraction
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
CS240: Advanced Programming Concepts
Objects First with Java
CS240: Advanced Programming Concepts
Object Oriented Practices
Authors: Barry Smyth, Mark T. Keane, Padraig Cunningham
Software Design Principles
Object Oriented Analysis and Design
HFOOAD Chapter 5 Interlude
Presentation transcript:

CS240: Advanced Programming Concepts Week 6 Thursday

Things to study Things To Study JSON SQLite JavaDoc/javadoc http://www.json.org/ SQLite https://www.sqlite.org/about.html JavaDoc/javadoc https://students.cs.byu.edu/~cs240ta/fall2016/tutorials/Java_Doc_Tutorial.pdf Junit Testing http://www.vogella.com/tutorials/JUnit/article.html Android Book: Chapters 3 - 5

Decomposition Levels of decomposition Hypo- and Hyper-Decomposition System Subsystem Packages Classes Routines Hypo- and Hyper-Decomposition When have we decomposed far enough? Size metrics Complexity metrics Single responsibility

Algorithm & Data Structure Selection No amount of decomposition or abstraction will hide a fundamentally flawed selection of algorithm or data structure.

Minimize Dependencies Class A CALLS Class B Class A HAS MEMBER OF Class B Class A INHERITS FROM Class B

Minimize Dependencies Minimizing the number of interactions between different classes has several benefits: A class with few dependencies is easier to understand A class with few dependencies is less prone to ripple effects A class with few dependencies is easier to reuse

Minimize Dependencies When classes must interact, if possible they should do so through simple method calls This kind of dependency is clear in the code and relatively easy to understand

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 interface Stack + class StackImpl 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 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