SlideShare a Scribd company logo
10.3 Object-Oriented Programming
Object-oriented programming is a style of programming where programs are
broken down into objects that can be combined to solve a problem or model a simulated
world.
The notion of designing programs around object manipulations goes back at least
to Ada (see the quote at the end if Chapter 6), but started in earnest in the early 1960s.
During World War II, the US Navy began to consider the possibility of building
a airplane simulator for training pilots and aiding aircraft designers.
At the time, pilots trained in mechanical simulators that were custom designed
for particular airplanes. The Navy wanted a simulator that could be used for
multiple airplanes and could accurately model the aerodynamics of different airplanes.
Project Whirlwind was started at MIT to build the simulator. The initial plans called for
an analog computer which would need to be manually reconfigured to change the
aerodynamics model to a different airplane.
Jay Forrester learned about emerging projects to build digital computers,
including ENIAC which became operational in 1946, and realized that building a
programmable digital computer would enable a much more flexible and powerful
simulator, as well as a machine that could be used for many other purposes.
Before Whirlwind, all digital computers operated as batch processors where
a programmer creates a program (typically described using a stack of punch cards) and
submits it to the computer.
A computer operator would set up the computer to run the program, after which
it would run and (hopefully) produce a result.
A flight simulator, though, requires direct interaction between a human user and
the computer.
The first Whirlwind computer was designed in 1947 and operational by 1950. It was the
first interactive programmable digital computer.
Producing a machine that could perform the complex computations needed for a flight
simulator fast enough to be used interactively required much faster and more reliable
memory that was possible with available technologies based on storing
electrostatic charges in vacuum tubes.
Jay Forrester invented a much faster memory based known as magnetic-core memory.
Magnetic-core memory stores a bit using magnetic polarity.
The interactiveness of the Whirlwind computer opened up many new possibilities for
computing.
Shortly after the first Whirlwind computer, Ken Olson led an effort to build a version of
the computer using transistors.
themselves.
The successor to this machine became the TX-2, and Ken Olsen went on to found Digital
Equipment Corporation (DEC) which pioneered the widespread use of moderately
priced computers in science and industry.
DEC was very successful in the 1970s and 1980s, but suffered a long decline
before eventually being bought by Compaq.
Ivan Sutherland, then a graduate student at MIT, had an opportunity to use the TX-2
machine. He developed a program called Sketchpad that was the first program to have
an interactive graphical interface.
Sketchpad allowed users to draw and manipulate objects on the screen using a light pen.
It was designed around objects and operations on those objects:1
In the process of making the Sketchpad system operate, a few very general functions
were developed which make no reference at all to the specific types of entities on which
they operate.
These general functions give the Sketchpad system the ability to operate on a
wide range of problems.
The motivation for making the functions as general as possible came from the desire to
get as much result as possible from the programming effort involved…… Each of the
general functions implemented in the Sketchpad system abstracts, in some sense, some
common property of pictures independent of the specific subject matter of the pictures
task. The documentation was incomprehensible.
Sketchpad was a great influence on Douglas Engelbart who developed a research
program around a vision of using computers interactively to enhance human intellect.
In what has become known as "the mother of all demos", Engelbart and his colleagues
demonstrated a networked, graphical, interactive computing system to the general
public for the first time in 1968.
With Bill English, Engelbard also invented the computer mouse.
Sketchpad also influenced Alan Kay in developing object-oriented programming.
The first language to include support for objects was the Simula programming
language, developed in Norway in the 1960s by Kristen Nygaard and Ole Johan Dahl.
Simula was designed as a language for implementing simulations. It
provided mechanisms for packaging data and procedures, and for implementing
subclasses using inheritance.
In 1966, Alan Kay entered graduate school at the University of Utah, where Ivan
Sutherland was then a professor. Here's how he describes his first assignment:
Head whirling, I found my desk. On it was a pile of tapes and listings, and a
note: "This is the Algol for the 1108.
It doesn't work. Please make it work.'' The latest graduate student gets the latest dirty
object-oriented language.
Supposedly, this was the Case-Western Reserve 1107 Algol---but it had been doctored
to make a language called Simula; the documentation read like Norwegian
transliterated into English, which in fact it was.
There were uses of words like activity and process that didn't seem to coincide with
normal English usage.
Finally, another graduate student and I unrolled the program listing 80 feet down the
hall and crawled over it yelling discoveries to each other.
The weirdest part was the storage allocator, which did not obey a stack discipline as
was usual for Algol. A few days later, that provided the clue.
What Simula was allocating were structures very much like the instances
of
Sketchpad. There were descriptions that acted like masters and they could create
instances, each of which was an independent entity. ……
This was the big hit, and I've not been the same since…… For the first time I thought of
the whole as the entire computer and wondered why anyone would want to divide it
up into weaker things called data structures and procedures.
Why not divide it up into little computers, as time sharing was starting to? But not in
dozens. Why not thousands of them, each simulating a useful structure?
Alan Kay went on to design the language Smalltalk, which became the first widely used
Smalltalk was developed as part of a project at XEROX's Palo Alto Research Center to
develop a hand-held computer that could be used as a learning environment by
children.
In Smalltalk, everything is an object, and all computation is done by sending messages
to objects. For example, in Smalltalk one computes (+ 1 2) by sending the message + 2 to
the object 1. Here is Smalltalk code for implementing a counter object:
class name counter
variable names count
new count <- 0
next
count <- count + 1
instance
current ^ count
The new method is a constructor analogous to make-counter. The count instance
variable stores the current value of the counter, and the next method updates the
counter value by sending the message + 1 to the count object.
Nearly all widely-used languages today provide built-in support for some form of object-
oriented programming. For example, here is how a counter object could be defined in
Python:
class counter:
def
def
init (self):
self._count = 0 rest(self):
self._count = 0
def next(self): self._count =
self._count + 1
def current(self): return self._count
The constructor is named init . Similarly to the object system we developed
for Scheme, each method takes the self object as its parameter.
Smalltalk was developed as part of a project at XEROX's Palo Alto Research Center to
develop a hand-held computer that could be used as a learning environment by
children.
In Smalltalk, everything is an object, and all computation is done by sending messages
to objects. For example, in Smalltalk one computes (+ 1 2) by sending the message + 2 to
the object 1. Here is Smalltalk code for implementing a counter object:
class name counter
variable names count
new count <- 0
next
count <- count + 1
instance
current ^ count
The new method is a constructor analogous to make-counter. The count instance
variable stores the current value of the counter, and the next method updates the
counter value by sending the message + 1 to the count object.
Nearly all widely-used languages today provide built-in support for some form of object-
oriented programming. For example, here is how a counter object could be defined in
Python:
class counter:
def
def
init (self):
self._count = 0 rest(self):
self._count = 0
def next(self): self._count =
self._count + 1
def current(self): return self._count
The constructor is named init . Similarly to the object system we developed
for Scheme, each method takes the self object as its parameter.

More Related Content

Viewers also liked

composing procedures
composing procedurescomposing procedures
composing procedures
Rajendran
 
scheme
scheme scheme
scheme
Rajendran
 
language construction
language constructionlanguage construction
language construction
Rajendran
 
packaging procedures_and_state
packaging procedures_and_statepackaging procedures_and_state
packaging procedures_and_state
Rajendran
 
Introduction to trees
Introduction to treesIntroduction to trees
Introduction to trees
Rajendran
 
Tree basics
Tree basicsTree basics
Tree basics
Rajendran
 
1.2 steps and functionalities
1.2 steps and functionalities1.2 steps and functionalities
1.2 steps and functionalities
Rajendran
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
Rajendran
 
Chomsky & Greibach Normal Forms
Chomsky & Greibach Normal FormsChomsky & Greibach Normal Forms
Chomsky & Greibach Normal Forms
Rajendran
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
Rajendran
 
Shell sort
Shell sortShell sort
Shell sort
Rajendran
 
Partial compute function
Partial compute functionPartial compute function
Partial compute function
Rajendran
 
Ambiguty
AmbigutyAmbiguty
Ambiguty
Rajendran
 

Viewers also liked (13)

composing procedures
composing procedurescomposing procedures
composing procedures
 
scheme
scheme scheme
scheme
 
language construction
language constructionlanguage construction
language construction
 
packaging procedures_and_state
packaging procedures_and_statepackaging procedures_and_state
packaging procedures_and_state
 
Introduction to trees
Introduction to treesIntroduction to trees
Introduction to trees
 
Tree basics
Tree basicsTree basics
Tree basics
 
1.2 steps and functionalities
1.2 steps and functionalities1.2 steps and functionalities
1.2 steps and functionalities
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Chomsky & Greibach Normal Forms
Chomsky & Greibach Normal FormsChomsky & Greibach Normal Forms
Chomsky & Greibach Normal Forms
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
Shell sort
Shell sortShell sort
Shell sort
 
Partial compute function
Partial compute functionPartial compute function
Partial compute function
 
Ambiguty
AmbigutyAmbiguty
Ambiguty
 

Similar to object oriented-programming

Software Engineering
Software EngineeringSoftware Engineering
Software EngineeringSanjay Saluth
 
ENIC Symbols
ENIC SymbolsENIC Symbols
ENIC Symbols
Tanya Williams
 
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdfAtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
quickfix043
 
Geek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming Languages
GeekNightHyderabad
 
GeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming LanguagesGeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming Languages
Hyderabad Scalability Meetup
 
Evolution of computer
Evolution of computerEvolution of computer
Evolution of computerAnkit Yadav
 
2 evolution of computer systems
2 evolution of computer systems2 evolution of computer systems
2 evolution of computer systems
Nymphea Saraf
 
1.lecture_07_paradigms.ppt
1.lecture_07_paradigms.ppt1.lecture_07_paradigms.ppt
1.lecture_07_paradigms.ppt
Usamajawad3
 
The world's most famous programmers
The world's most famous programmersThe world's most famous programmers
The world's most famous programmers
Arno Huetter
 
CT1101 - Computer Technology
CT1101 - Computer TechnologyCT1101 - Computer Technology
CT1101 - Computer Technology
Pratik Pradhan
 
Machine Learning Overview: How did we get here ?
Machine Learning Overview: How did we get here ?Machine Learning Overview: How did we get here ?
Machine Learning Overview: How did we get here ?
Universitat Politècnica de Catalunya
 
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdf
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdfChapter 15 Networks Read in this book Computer Science Illuminated, .pdf
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdf
mohdjakirfb
 
History of Computer
History of ComputerHistory of Computer
History of Computer
Nxr Ktk
 
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptxBASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
jeromeyano
 
C++ 1.pdf
C++ 1.pdfC++ 1.pdf
C++ 1.pdf
captabdulhadi73
 
Pascal programming language
Pascal programming languagePascal programming language
Pascal programming language
Verónica Meo Laos
 
Interaction Design History
Interaction Design HistoryInteraction Design History
Interaction Design History
Marc Rettig
 
Computer science Information Technology (By Aparna Vilas Desai)
Computer science Information Technology (By Aparna Vilas Desai)Computer science Information Technology (By Aparna Vilas Desai)
Computer science Information Technology (By Aparna Vilas Desai)
AparnaDesai13
 

Similar to object oriented-programming (20)

IMD 203 - Ch01
IMD 203 - Ch01IMD 203 - Ch01
IMD 203 - Ch01
 
Software Engineering
Software EngineeringSoftware Engineering
Software Engineering
 
ENIC Symbols
ENIC SymbolsENIC Symbols
ENIC Symbols
 
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdfAtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
AtkinFVFsonDFDFFDFDFDFDFFADASADADADADAS.pdf
 
Geek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming LanguagesGeek Night 16.0 - Evolution of Programming Languages
Geek Night 16.0 - Evolution of Programming Languages
 
GeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming LanguagesGeekNight: Evolution of Programming Languages
GeekNight: Evolution of Programming Languages
 
Evolution of computer
Evolution of computerEvolution of computer
Evolution of computer
 
2 evolution of computer systems
2 evolution of computer systems2 evolution of computer systems
2 evolution of computer systems
 
1.lecture_07_paradigms.ppt
1.lecture_07_paradigms.ppt1.lecture_07_paradigms.ppt
1.lecture_07_paradigms.ppt
 
The world's most famous programmers
The world's most famous programmersThe world's most famous programmers
The world's most famous programmers
 
CT1101 - Computer Technology
CT1101 - Computer TechnologyCT1101 - Computer Technology
CT1101 - Computer Technology
 
Machine Learning Overview: How did we get here ?
Machine Learning Overview: How did we get here ?Machine Learning Overview: How did we get here ?
Machine Learning Overview: How did we get here ?
 
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdf
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdfChapter 15 Networks Read in this book Computer Science Illuminated, .pdf
Chapter 15 Networks Read in this book Computer Science Illuminated, .pdf
 
History of Computer
History of ComputerHistory of Computer
History of Computer
 
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptxBASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
BASIC COMPUTER REPORT for Computer science subject in 1st year.pptx
 
C++ 1.pdf
C++ 1.pdfC++ 1.pdf
C++ 1.pdf
 
IT/Tech quiz
IT/Tech quizIT/Tech quiz
IT/Tech quiz
 
Pascal programming language
Pascal programming languagePascal programming language
Pascal programming language
 
Interaction Design History
Interaction Design HistoryInteraction Design History
Interaction Design History
 
Computer science Information Technology (By Aparna Vilas Desai)
Computer science Information Technology (By Aparna Vilas Desai)Computer science Information Technology (By Aparna Vilas Desai)
Computer science Information Technology (By Aparna Vilas Desai)
 

More from Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
Rajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
Rajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
Rajendran
 
Red black tree
Red black treeRed black tree
Red black tree
Rajendran
 
Hash table
Hash tableHash table
Hash table
Rajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
Rajendran
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
Rajendran
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
Rajendran
 
Master method
Master method Master method
Master method
Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
Rajendran
 
Hash tables
Hash tablesHash tables
Hash tables
Rajendran
 
Lower bound
Lower boundLower bound
Lower bound
Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
Rajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
Rajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
Rajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
Rajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
Rajendran
 
Np completeness
Np completenessNp completeness
Np completeness
Rajendran
 
computer languages
computer languagescomputer languages
computer languages
Rajendran
 

More from Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 

Recently uploaded

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 

Recently uploaded (20)

The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

object oriented-programming

  • 1. 10.3 Object-Oriented Programming Object-oriented programming is a style of programming where programs are broken down into objects that can be combined to solve a problem or model a simulated world. The notion of designing programs around object manipulations goes back at least to Ada (see the quote at the end if Chapter 6), but started in earnest in the early 1960s. During World War II, the US Navy began to consider the possibility of building a airplane simulator for training pilots and aiding aircraft designers. At the time, pilots trained in mechanical simulators that were custom designed for particular airplanes. The Navy wanted a simulator that could be used for multiple airplanes and could accurately model the aerodynamics of different airplanes. Project Whirlwind was started at MIT to build the simulator. The initial plans called for an analog computer which would need to be manually reconfigured to change the aerodynamics model to a different airplane. Jay Forrester learned about emerging projects to build digital computers, including ENIAC which became operational in 1946, and realized that building a programmable digital computer would enable a much more flexible and powerful simulator, as well as a machine that could be used for many other purposes.
  • 2. Before Whirlwind, all digital computers operated as batch processors where a programmer creates a program (typically described using a stack of punch cards) and submits it to the computer. A computer operator would set up the computer to run the program, after which it would run and (hopefully) produce a result. A flight simulator, though, requires direct interaction between a human user and the computer. The first Whirlwind computer was designed in 1947 and operational by 1950. It was the first interactive programmable digital computer. Producing a machine that could perform the complex computations needed for a flight simulator fast enough to be used interactively required much faster and more reliable memory that was possible with available technologies based on storing electrostatic charges in vacuum tubes. Jay Forrester invented a much faster memory based known as magnetic-core memory. Magnetic-core memory stores a bit using magnetic polarity. The interactiveness of the Whirlwind computer opened up many new possibilities for computing. Shortly after the first Whirlwind computer, Ken Olson led an effort to build a version of the computer using transistors.
  • 3. themselves. The successor to this machine became the TX-2, and Ken Olsen went on to found Digital Equipment Corporation (DEC) which pioneered the widespread use of moderately priced computers in science and industry. DEC was very successful in the 1970s and 1980s, but suffered a long decline before eventually being bought by Compaq. Ivan Sutherland, then a graduate student at MIT, had an opportunity to use the TX-2 machine. He developed a program called Sketchpad that was the first program to have an interactive graphical interface. Sketchpad allowed users to draw and manipulate objects on the screen using a light pen. It was designed around objects and operations on those objects:1 In the process of making the Sketchpad system operate, a few very general functions were developed which make no reference at all to the specific types of entities on which they operate. These general functions give the Sketchpad system the ability to operate on a wide range of problems. The motivation for making the functions as general as possible came from the desire to get as much result as possible from the programming effort involved…… Each of the general functions implemented in the Sketchpad system abstracts, in some sense, some common property of pictures independent of the specific subject matter of the pictures
  • 4. task. The documentation was incomprehensible. Sketchpad was a great influence on Douglas Engelbart who developed a research program around a vision of using computers interactively to enhance human intellect. In what has become known as "the mother of all demos", Engelbart and his colleagues demonstrated a networked, graphical, interactive computing system to the general public for the first time in 1968. With Bill English, Engelbard also invented the computer mouse. Sketchpad also influenced Alan Kay in developing object-oriented programming. The first language to include support for objects was the Simula programming language, developed in Norway in the 1960s by Kristen Nygaard and Ole Johan Dahl. Simula was designed as a language for implementing simulations. It provided mechanisms for packaging data and procedures, and for implementing subclasses using inheritance. In 1966, Alan Kay entered graduate school at the University of Utah, where Ivan Sutherland was then a professor. Here's how he describes his first assignment: Head whirling, I found my desk. On it was a pile of tapes and listings, and a note: "This is the Algol for the 1108. It doesn't work. Please make it work.'' The latest graduate student gets the latest dirty
  • 5. object-oriented language. Supposedly, this was the Case-Western Reserve 1107 Algol---but it had been doctored to make a language called Simula; the documentation read like Norwegian transliterated into English, which in fact it was. There were uses of words like activity and process that didn't seem to coincide with normal English usage. Finally, another graduate student and I unrolled the program listing 80 feet down the hall and crawled over it yelling discoveries to each other. The weirdest part was the storage allocator, which did not obey a stack discipline as was usual for Algol. A few days later, that provided the clue. What Simula was allocating were structures very much like the instances of Sketchpad. There were descriptions that acted like masters and they could create instances, each of which was an independent entity. …… This was the big hit, and I've not been the same since…… For the first time I thought of the whole as the entire computer and wondered why anyone would want to divide it up into weaker things called data structures and procedures. Why not divide it up into little computers, as time sharing was starting to? But not in dozens. Why not thousands of them, each simulating a useful structure? Alan Kay went on to design the language Smalltalk, which became the first widely used
  • 6. Smalltalk was developed as part of a project at XEROX's Palo Alto Research Center to develop a hand-held computer that could be used as a learning environment by children. In Smalltalk, everything is an object, and all computation is done by sending messages to objects. For example, in Smalltalk one computes (+ 1 2) by sending the message + 2 to the object 1. Here is Smalltalk code for implementing a counter object: class name counter variable names count new count <- 0 next count <- count + 1 instance current ^ count The new method is a constructor analogous to make-counter. The count instance variable stores the current value of the counter, and the next method updates the counter value by sending the message + 1 to the count object. Nearly all widely-used languages today provide built-in support for some form of object- oriented programming. For example, here is how a counter object could be defined in Python: class counter: def def init (self): self._count = 0 rest(self): self._count = 0 def next(self): self._count = self._count + 1 def current(self): return self._count The constructor is named init . Similarly to the object system we developed for Scheme, each method takes the self object as its parameter.
  • 7. Smalltalk was developed as part of a project at XEROX's Palo Alto Research Center to develop a hand-held computer that could be used as a learning environment by children. In Smalltalk, everything is an object, and all computation is done by sending messages to objects. For example, in Smalltalk one computes (+ 1 2) by sending the message + 2 to the object 1. Here is Smalltalk code for implementing a counter object: class name counter variable names count new count <- 0 next count <- count + 1 instance current ^ count The new method is a constructor analogous to make-counter. The count instance variable stores the current value of the counter, and the next method updates the counter value by sending the message + 1 to the count object. Nearly all widely-used languages today provide built-in support for some form of object- oriented programming. For example, here is how a counter object could be defined in Python: class counter: def def init (self): self._count = 0 rest(self): self._count = 0 def next(self): self._count = self._count + 1 def current(self): return self._count The constructor is named init . Similarly to the object system we developed for Scheme, each method takes the self object as its parameter.