Section 12 - Object-Orientated Programming - USE NOTES Flashcards
What is a procedural language?
A program consisting of:
- Step-by-step instructions
- Function and procedure calls
- Local and global variables
How does procedural programming work?
Code is broken down into a number of smaller modules, with the program consisting of a series of calls to procedures and functions, each of which may in turn call other procedures or functions
How does object orientated programming work?
The world is viewed as a system of objects, each of which is responsible for its own data and the operations on that data. All processing carried out is done by the objects
What are attributes?
Data that is associated with the class
What features do objects have?
- Attributes
- State
- Behaviours
What are states?
The value of an objects instance variables
What are behaviours?
Actions that can be performed by an object
What is a class?
A blueprint or template for an object that defines the attributes and behaviours of those objects
What is a method?
Attributes and behaviours of an object, they are the functionality of a class
What is a constructor?
Something used to create objects in a class
What are setter methods?
Procedures
What are getter methods?
Functions
What is instantiation?
Where a new object (an instance of a class) is created
Can multiple instances of the same class be created?
Yes, they will share identical methods and attributes, however the value of their attributes will be unique to each instance
What is a reference type variable?
Variables that hold a pointer or reference to where the object itself is stored
What is a variable reference diagram?
A graphical form showing how objects are referenced by reference variables