1 Object-Oriented Programming Using C++ CLASS 17 Honors.

Slides:



Advertisements
Similar presentations
Chapter 13 – Introduction to Classes
Advertisements

4. Object-Oriented Programming Procedural programming Structs and objects Object-oriented programming Concepts and terminology Related keywords.
Programming Paradigms and languages
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Programming Logic and Design Fourth Edition, Introductory
Overview1 History of Programming Languages n Machine languages n Assembly languages n High-level languages – Procedure-oriented – Object-oriented/Event-driven.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
Design The goal is to design a modular solution, using the techniques of: Decomposition Abstraction Encapsulation In Object Oriented Programming this is.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Lecturer: Dr. AJ Bieszczad Chapter 66-1 Object-Oriented analysis and design Special nature of OO development Use cases Design with UML OO system design.
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.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 1 Program Design
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Chapter 22 Object-Oriented Design
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
C++ fundamentals.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Your Interactive Guide to the Digital World Discovering Computers 2012.
Chapter 5CSA 217 Design in Construction Chapter 5 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
An Object-Oriented Approach to Programming Logic and Design
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
CSE 219 Computer Science III Program Design Principles.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
1 Life Cycle of Software Specification Design –Risk Analysis –Verification Coding Testing –Refining –Production Maintenance.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CSE 303 – Software Design and Architecture LECTURE 4.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.
Chapter 10 Introduction to Classes
Design.ppt1 Top-down designs: 1. Define the Problem IPO 2. Identify tasks, Modularize 3. Use structure chart 4. Pseudocode for Mainline 5. Construct pseudocode.
Starting Out with C++, 3 rd Edition 1 Chapter 13 – Introduction to Classes.
Developing Business/IT Solutions Chapter 12 McGraw-Hill/IrwinCopyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Data Abstaraction Chapter 10.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
1.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
© 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.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 2 Principles of Programming and Software Engineering.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Starting Out with C++, 3 rd Edition 1 Chapter 13 – Introduction to Classes Procedural and Object-Oriented Programming Procedural programming is a method.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
CSE 2341 Object Oriented Programming with C++ Note Set #4
Chapter 11: Abstract Data Types Lecture # 17. Chapter 11 Topics The Concept of Abstraction Advantages of Abstract Data Types Design Issues for Abstract.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Principles of Programming & Software Engineering
Object Oriented Programming
Principles of Programming and Software Engineering
OOP What is problem? Solution? OOP
Need for the subject.
Chapter 1 Introduction(1.1)
Information Hidding Dr. Veton Kepuska.
Presentation transcript:

1 Object-Oriented Programming Using C++ CLASS 17 Honors

2 Understand the difference between Structured Programming and Object-Oriented Programming Objectives

3 What is Object-Oriented Programming? A new way of thinking A different approach to the solution to a problem

4 Object-Oriented Design vs. Structured Approach Decompose the problem into tasks Write procedures (functions) to solve simple tasks and compose them into a more sophisticated process until desired functionality is reached Structured Approach

5 Object-Oriented Design vs. Structured Approach Little regulation of access to data Focus is on looking for operations Unit testing/integration Structured Approach

6 Object-Oriented Design vs. Structured Approach Describe a problem in terms of things rather than activities Object-Oriented Approach

7 What action does an elevator perform? Goes up Goes down What does an elevator contain? • Button • Rider

8 Object-Oriented Design vs. Structured Approach Identify objects and the operations to be performed on these objects Object-Oriented Approach

9 What does a rider do with an elevator? Gets on Gets off Pushes buttons

10 Object-Oriented Design vs. Structured Approach Object-oriented design and programming encourages gradual growth by attaching more working class clusters and repeated testing Object-Oriented Approach

11 What are Some Problems with the Structured Approach Time estimates Low-quality High-maintenance Duplication of effort What is the Solution • Improve the tool (the language) • Improve the process

12 Word Processing Program In a structured approach functions A program bug is detected Problem could be in any of those functions

13 Word Processing Program In OOP, every operation is associated with a particular class. Error detection is quicker: We could have 100 classes with 20 operations per class. A program bug is detected Problem is in one of the 100 classes

14 A simple OOD example showing ease of extension/modification to software: You are given an assignment to write a program to create and print out a database of inventory items.

15 Inventory Getdata for item Printdata for item

16 Inventory Getdata for item Printdata for item Getdata Prompt and read in item # Prompt and read in unit price Prompt and read in quantity in stock

17 Inventory Getdata for item Printdata for item Getdata Prompt and read in item # Prompt and read in unit price Prompt and read in quantity in stock Printdata Print item # Print item price Print item quantity

18 Pipes Need length, size and type Light Bulbs Paint Watts Size Color

19 Create a pipe object Inventory - Object-Oriented Approach

20 Create a pipe object Apply getdata to pipe object Inventory - Object-Oriented Approach

21 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Inventory - Object-Oriented Approach

22 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Create a light bulb object Inventory - Object-Oriented Approach

23 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Create a light bulb object Apply getdata to light bulb object Inventory - Object-Oriented Approach

24 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it’s own getdata also Inventory - Object-Oriented Approach

25 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it’s own getdata also Create a paint object Inventory - Object-Oriented Approach

26 Create a pipe object Apply getdata to pipe object Pipe object has it’s own getdata also Create a light bulb object Apply getdata to light bulb object Light object has it’s own getdata also Create a paint object Apply getdata to a paint object Inventory - Object-Oriented Approach

27 Apply printdata to the above objects Inventory - Object-Oriented Approach

Procedural and Object- Oriented Programming Procedural programming is a method of writing software. It is a programming practice centered on the procedures, or actions that take place in a program. Object-Oriented programming is centered around the object. Objects are created form abstract data types that encapsulate data and functions together.

29 What’s Wrong with Procedural Programming? Programs with excessive global data Complex and convoluted programs Programs that are difficult to modify and extend

30 What is Object-Oriented Programming? OOP is centered around the object, which packages together both the data and the functions that operate on the data.

31 Figure 13-1

32 Terminology In OOP, an object’s member variables are often called its attributes and its member functions are sometimes referred to as its behaviors or methods.

33 Figure 13-2

How are Objects Used? Although the use of objects is only limited by the programmer’s imagination, they are commonly used to create data types that are either very specific or very general in purpose.

35 General Purpose Objects Creating data types that are improvements on C++’s built-in data types. For example, an array object could be created that works like a regular array, but additionally provides bounds-checking. Creating data types that are missing from C++. For instance, an object could be designed to process currencies or dates as if they were built-in data types. Creating objects that perform commonly needed tasks, such as input validation and screen output in a graphical user interface.

36 Application-Specific Objects Data types created for a specific application. For example, in an inventory program.

37 Advantages of Object-Oriented Programming Data abstraction details of classes only visible to its methods Compatibility easier to combine software components Flexibility classes provide units for task allocation

38 Advantages of Object-Oriented Programming Reuse easier to develop reusable software Extensibility inheritance allows new classes to be built from old ones Maintenance The natural modularity of the class structures makes it easier to contain the effects of change

39 Q & A