Object Oriented Programming - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Object Oriented Programming

Description:

Good programmer can generate 100 lines per day. 5000 days (13.7 years) ... Views the world as a collection of Objects ... Car. Truck. SUV. 10. OOP Programming ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 16
Provided by: Horn82
Category:

less

Transcript and Presenter's Notes

Title: Object Oriented Programming


1
Object Oriented Programming
  • 03/24/2005

2
Need for OOP
  • Complexity
  • MS Word is 500,000 lines of code
  • 50 lines per page
  • 10,000 pages
  • 40 paperbacks

3
Need for OOP
  • Code Reuse
  • Good programmer can generate 100 lines per day
  • 5000 days (13.7 years)
  • Code Sharing
  • Team programming
  • Less coordination needed
  • Divide the book into chapters

4
Need for OOP
  • GUI
  • Event driven
  • Software is waiting for user input

5
OOP
  • Higher level of abstraction
  • Views the world as a collection of Objects
  • Object is a grouping of some data together with
    the instructions that act on the data.
  • Self-contained bundle
  • Object is a meaningful thing

6
OOP
  • About simulating or modeling real-word problems
  • Model is built from objects that interact
  • The closer the model is to reality the better the
    program will do what is desired.

7
OOP
  • Examples
  • Word processor
  • Words, pages, lines, headings
  • Airline reservation system
  • Flights, seats , destinations
  • Student information system
  • Students, classes, majors

8
Objects
  • Tools that provide the programmer with two
    things
  • Modularity
  • a program consists of separate self-contained
    objects
  • Simulation
  • A powerful idea for modeling real-word problems

9
Classes
  • General type of object
  • Abstract model
  • Programmer creates specific instances of the
    class
  • Vehicle (class)
  • Car
  • Truck
  • SUV

10
OOP Programming
  • Describes the nature of the various classes that
    the program will use
  • Create the necessary objects
  • Write instructions on how the objects interact

11
Inheritance
  • Classification scheme
  • Classes can pass on their traits
  • New class
  • Old class (superclass, ancestor)
  • New stuff (subclass, descendent)

12
(No Transcript)
13
Properties
  • Objects have traits
  • Student
  • Student ID, Name, DoB, Major, Grades
  • Data to be used in the program
  • Variables

14
Methods
  • Procedures for manipulating the objects
  • Add new grade to student
  • Name change
  • Only way traits can be accessed and manipulated
  • Encapsulation

15
What Have We Gained?
  • Code reuse
  • No re-inventing the wheel
  • Improvement in reliability
  • Better maintainability
  • A more natural word-view
  • Escape from procedural scripts
  • Reality is not sequential
Write a Comment
User Comments (0)
About PowerShow.com