Understanding OOP - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Understanding OOP

Description:

Understand how Java is both compiled and interpreted. Understand the history of OOP ... Java can be used as a full-fledged programming environment ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 15
Provided by: bobmo3
Learn more at: http://cs.iupui.edu
Category:

less

Transcript and Presenter's Notes

Title: Understanding OOP


1
Understanding OOP
  • Java and Object-Oriented Programming

2
Lecture Goals
  • Understand how Java is both compiled and
    interpreted
  • Understand the history of OOP
  • Understand the term object
  • Understand the concept of class
  • Understand the concept of instance
  • Understand the concept of a reference

3
In the Beginning
  • Programming was done by re-wiring hundreds of
    thousands of wires
  • Extremely tedious
  • Extremely error-prone

4
Machine Language
  • Instructions stored as data
  • Still binary, though
  • Tied to specific CPUs
  • Tedious
  • Difficult to write
  • Difficult for humans to understand

5
Higher-Level Languages
Java
  • Allowed humans to work in a more human-like
    language
  • Could be translated to machine language

C
Python
Visual Basic
6
Interpreted vs. Compiled
Higher Level Languages can either be Interpreted
or Compiled
  • Interpreted
  • Similar to a real-time English translator
  • Very slow
  • Very flexible
  • Examples
  • Perl
  • JavaScript
  • Logo
  • Compiled
  • Entire program is translated first
  • Much faster
  • Some flexibility is lost
  • Examples
  • C
  • C

7
Evolution of Languages
Linear Languages
  • Things are done one at a time
  • No human intervention
  • Sequential logic
  • Entire program is a single entity
  • Spaghetti code
  • Example BASIC

8
Evolution of Languages
Procedural Languages
  • Programs are broken into procedures
  • Structured Programming
  • Each procedure is broken into a self-contained
    program
  • Parameter Passing
  • Examples Pascal, C

9
Evolution of Languages
Object Oriented Languages
  • Descendent of procedural languages
  • Programs and data are objects (an object is a set
    of data and the procedures to manipulate that
    data)
  • Event-driven interface
  • Example Java

10
How does Java fit?
  • Java is heavily object oriented
  • Java is event-driven (user controls outcome)
  • Java can be used as a full-fledged programming
    environment
  • Java is integrated very well into the Web
  • Java is somewhat platform-independent
  • Java is both compiled and interpreted

11
Compiled and Interpreted!
12
Programming as Modeling
  • Model elements represent more complex things
  • Model elements exhibit consistent behavior
  • Different elements can be grouped into different
    categories based on common behaviors
  • Actions external to the model can cause the
    behavior of an element

13
Objects in Java
  • Model elements in Java are called objects
  • Objects can exhibit behavior based on reactions
    to environment
  • Objects with similar behavior can be grouped into
    categories called classes
  • Every object belongs to one class and is said to
    be an instance of that class
  • Instances inherit all the properties and
    behaviors of their parent class
  • In programs, we use references as phrases which
    refer to an object

14
Questions?
Write a Comment
User Comments (0)
About PowerShow.com