Object Oriented Design

Similar documents
Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References

Chapter 1: Key Concepts of Programming and Software Engineering

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Course Title: Software Development

I PUC - Computer Science. Practical s Syllabus. Contents

Software Engineering Techniques

Data Flow Diagrams. Outline. Some Rules for External Entities 1/25/2010. Mechanics

Manufacturing View. User View. Product View. User View Models. Product View Models

Cohort: BCA/07B/PT - BCA/06/PT - BCNS/06/FT - BCNS/05/FT - BIS/06/FT - BIS/05/FT - BSE/05/FT - BSE/04/PT-BSE/06/FT

Java: Learning to Program with Robots. Chapter 11: Building Quality Software

Introduction to Programming System Design. CSCI 455x (4 Units)

Computing Concepts with Java Essentials

Ch 7-1. Object-Oriented Programming and Classes

Course MS10975A Introduction to Programming. Length: 5 Days

Software Design. Software Design. Software design is the process that adds implementation details to the requirements.

Basic Programming and PC Skills: Basic Programming and PC Skills:

Data Structures Using C++ 2E. Chapter 5 Linked Lists

AP Computer Science AB Syllabus 1

KWIC Implemented with Pipe Filter Architectural Style

Quotes from Object-Oriented Software Construction

Pseudo code Tutorial and Exercises Teacher s Version

ATM Case Study Part 1

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Database Programming with PL/SQL: Learning Objectives

Qint Software - Technical White Paper

Texas Essential Knowledge and Skills Correlation to Video Game Design Foundations 2011 N Video Game Design

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

ABET General Outcomes. Student Learning Outcomes for BS in Computing

Section IV.1: Recursive Algorithms and Recursion Trees

The Elective Part of the NSS ICT Curriculum D. Software Development

Programming Languages

COSC 3351 Software Design. Architectural Design (II) Edgar Gabriel. Spring Virtual Machine

WORKSPACE WEB DEVELOPMENT & OUTSOURCING TRAINING CENTER

Formal Engineering for Industrial Software Development

AP Computer Science A - Syllabus Overview of AP Computer Science A Computer Facilities

Terms and Definitions for CMS Administrators, Architects, and Developers

Section 1 Spreadsheet Design

Java SE 8 Programming

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

DESIGN REPORT FOR THE PROJECT INVENTORY CONTROL SYSTEM FOR CALCULATION AND ORDERING OF AVAILABLE AND PROCESSED RESOURCES

1 Description of The Simpletron

Software Testing. Quality & Testing. Software Testing

Software Specification and Testing

COMPUTER SCIENCE COURSE OUTLINE

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

CSC 342 Semester I: H ( G)

(Refer Slide Time 00:56)

KWIC Exercise. 6/18/ , Spencer Rugaber 1

Domains and Competencies

Algorithms, Flowcharts & Program Design. ComPro

COMPUTER SCIENCE (5651) Test at a Glance

Data Structures Using C++ 2E. Chapter 5 Linked Lists

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

PHP FRAMEWORK FOR DATABASE MANAGEMENT BASED ON MVC PATTERN

LECTURE 11: PROCESS MODELING

CPM release notes

Performing Simple Calculations Using the Status Bar

Loop Invariants and Binary Search

Course Scheduling Support System

6-1. Process Modeling

Job Streaming User Guide

High School Pathway Program Options: Benefits of successfully completing Griffith InfoTech

Excel Pivot Tables. Blue Pecan Computer Training Ltd - Onsite Training Provider :: :: info@bluepecan.co.

Symbol Tables. Introduction

VEDATRAK CRM 2.1. User's Guide

Glossary of Object Oriented Terms

Automation of Library (Codes) Development for Content Management System (CMS)

Implementing and Maintaining Microsoft SQL Server 2008 Integration Services

Reporting with Pentaho. Gabriele Pozzani

Introducing Formal Methods. Software Engineering and Formal Methods

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

Assignment 4 CPSC 217 L02 Purpose. Important Note. Data visualization

Specialized Programme on Web Application Development using Open Source Tools

Software Development Phases

OKLAHOMA SUBJECT AREA TESTS (OSAT )

AP Computer Science A Syllabus

CSE 308. Coding Conventions. Reference

Class XII (Theory) C++

Cobol. By: Steven Conner. COBOL, COmmon Business Oriented Language, one of the. oldest programming languages, was designed in the last six

OVERVIEW AND TERMINOLOGY

COINS User Guide: Human Resources Training Manual

Logistics. Software Testing. Logistics. Logistics. Plan for this week. Before we begin. Project. Final exam. Questions?

PA2: Word Cloud (100 Points)

Java Application Developer Certificate Program Competencies

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

Chapter 8: Bags and Sets

DOVER-SHERBORN HIGH SCHOOL PROGRAM OF STUDIES

RARITAN VALLEY COMMUNITY COLLEGE ACADEMIC COURSE OUTLINE. CISY 105 Foundations of Computer Science

INTERNET PROGRAMMING AND DEVELOPMENT AEC LEA.BN Course Descriptions & Outcome Competency

Instructional Design Framework CSE: Unit 1 Lesson 1

Computer Programming I

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

4. The Third Stage In Designing A Database Is When We Analyze Our Tables More Closely And Create A Between Tables

Chapter 7: Software Development Stages Test your knowledge - answers

Microsoft Excel 2007 Mini Skills Overview of Tables

Designing Reports in Access

Transcription:

Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three principles of Object Oriented Design Encapsulation discussed earlier Inheritance discussed later in the course Polymorphism discussed later in the course

Object Design Identify Objects Identify objects Identify objects that exist in the problem statement and requirements Typically, select nouns, ignoring irrelevant ones, such as synonyms Look for relationships amongst the (real-world) objects that were identified Generalization relates to inheritance Containment where one object contains another Multiplicity determine the quantity relationships between objects (e.g. one bank can have many accounts)

Object Design Identify Operations Identify the operations of objects Typically, select verbs, ignoring irrelevant ones, such as actions performed by the user Associate each operation with the object that is responsible for providing the behaviour Note that an object should be responsible for modifying its own data

Object Design Create Interface An interface should be created for each object that is to be represented by a class (rather than a variable) The interface describes how the class can be used, by specifying its public operations There are a number of ways of creating interfaces, e.g. C++ Header files Java Interface An interface should include: Class invariants (conditions that must be true for an object) Public methods, for each such define: Parameter lists Return type Purpose (i.e. a description) Pre and post conditions

Class Invariants A class invariant is an invariant on the values of the variables of an object, For example: Account balance is always >= 0 Account ID numbers are unique and cannot be modified All object constructors and mutators should respect class invariants That is, they should always make sure that class invariants are true

Pre-Conditions A pre-condition is an assertion about conditions at the beginning of a method An assertion is a statement about a condition It is part of the "contract" implicit in a method If the pre-conditions are not true then the method is not guaranteed to produce the desired results e.g. for binary search, there is a pre-condition that the array or list being searched is sorted, it is not, there is not guarantee that the correct result will be returned Or, to put it another way, that the post-conditions will hold

Post-Conditions A post-condition is an assertion about conditions at the end of a method The post-conditions describe the state after the method has been run They therefore describe the desired output of a method To prove that an algorithm is correct we need to prove that, if the pre-conditions are correct, following the steps of the algorithm will lead to the postconditions We should be able to show how the each step of an algorithm leads to the post-conditions

Example (Object Oriented Design) You have been hired to design an application for a company to record information about its employees. You have been given the following information about the application's requirements. The company has a number of branches. It is necessary to record the address of the building occupied by each branch, as well as the manager (who is an employee). The company also needs to record the unique employee ID, first name, last name and annual salary of each employee. Each employee works for one and only one branch. The application will be used to perform the following tasks: Insert and delete (fire) employees, and transfer them between branches Change any employee information (with exception of the which employee's IDs cannot be changed, also note that an employee's salary cannot go below zero) Retrieve employee information Insert and delete branches; branches can only be deleted if they have no employees Change branch data Retrieve branch data, including the monthly payroll costs (the sum of the annual salaries of all employees who work for the branch divided by 12)

Object Interaction Design Design the entire application by describing how the objects are to interact with each other One approach is to write a high level algorithm and then decompose it into several methods Each such method should have one specific purpose

Operation Design Each of the operations identified in the object design should be designed If possible, re-use previously written methods or functions Otherwise design algorithms to implement each operation

Test Design Determine how each class (or unit, or module) will be tested before writing the application Write unit test cases that test the entire range of input that can be given to a method Expected values Boundary values Invalid values For each input specify the expected result and when testing is performed compare this to the actual result Debug where necessary!

What makes a good program? Modularity Favorable impact on program development Modifiability Use of methods and named constants Ease of Use Considerations for the user interface Program should prompt the user for input A program should always echo its input The output should be well labeled and easy to read

What makes a good program? Efficient Fail-Safe Programming Fail-safe program A program that will perform reasonably no matter how anyone uses it Types of errors: Errors in input data Errors in the program logic

What makes a good program? Style Five issues of style Extensive use of methods Use of private data fields Error handling Readability Documentation