1.2: Comparing Procedural Programming to Object-Oriented Programming Flashcards
Two popular approaches to writing computer programs
Procedural programming
Object-Oriented Programming
Writing computer programs as sets of operations executed in sequence
Procedural Programming
Named computer memory locations that hold values
Variables
Individual operations grouped into logical units
Procedures
It is an extension of procedural programming in which you take a slightly different approach to writing computer programs
Object-Oriented Programming
Writing object-oriented programs involves:
Creating classes, objects, and applications
Blueprints for objects in object-oriented programming
Classes
Specific instances of classes in object-oriented programming
Objects
Manipulates/uses objects in object-oriented programming
Applications
The three basic concepts in object-oriented programming
Encapsulation
Inheritance
Polymorphism
A term that describes a group or collection of objects with common properties.
Class
Describes what attributes a class’s objects will have and what those objects will be able to do.
Class definition
The characteristics that define an object.
Thy are properties of an object
Attributes
A specific, concrete instance of a class
Object
What creating an instance is called
Instantiation
The values of the properties of an object
State
Besides defining properties, classes can also define what?
Methods their objects can use
A self-contained block of program code that carries out some action
Method
The enclosure of data and methods within an object. It allows the treatment of all of an object’s methods and data as a single entity
It also refers to the concealment of an object’s data and methods from outside sources. It lets you hide specific object attributes and methods from outside sources
Encapsulation
Concealing data is sometimes called as:
Information hiding
Concealing how methods work is referred to as:
Implementation hiding
The ability to create classes that share the attributes and methods of existing classes, but with more specific features.
Inheritance
Allows the same word or symbol to be interpreted correctly in different situations based on the context.
Means “many forms”
Polymorphism