20 - further programming Flashcards
programming paradigm
a set of programming concepts
- low level, imperative, object oriented, declarative
low level programming
programming instructions that use the computer’s basic instruction set.
- assembly language, machine code
- used when program makes use of specific addresses and registers in a comp
eg writing a printer driver
imperative programming
programming paradigm in which the steps required to execute a program are set out in the order they need to be carried out
- may be smaller and take less time to execute - fewer instructions and less data storage required
- good for small, simple programs, easy to read
object oriented programming
a programming methodology that uses self-
contained objects, which contain programming statements (methods) and data, and which
communicate with each other
- more complex problems, enables programmers to work with real life things
class
a template defining the methods and data of a certain type of object
attributes
the data items in a class.
method
a programmed procedure that is defined as part of a class.
encapsulation
process of putting data and methods together as a single unit, a class.
object
an instance of a class that is self-contained and includes data and methods.
property
data and methods within an object that perform a named action.
instance
An occurrence of an object during the execution of a program.
data hiding
technique which protects the integrity of an object by restricting access to the
data and methods within that object.
inheritance
process in which the methods and data from one class, a superclass or base class, are copied to another class, a derived class.
polymorphism
feature of object-oriented programming that allows methods to be redefined
for derived classes.
overloading
feature of object-oriented programming that allows a method to be defined
more than once in a class, so it can be used in different situations.
eg use the method with different parameters
containment
process by which one class can contain other classes.
destructor
a method that is automatically invoked when an object is destroyed.
declarative programming
statements of facts and rules together with a mechanism for setting goals in the form of a query.
writing a program for a binary tree
exception
an unexpected event that disrupts the execution of a program
caused by:
- programming errors
- user errors
- hardware failure
eg /0, reaching end of file unexpectedly, trying to open a file that doesn’t exist, losing connection to a device eg printer
exception handling
the process of responding to an exception within the program so that the program does not halt unexpectedly.
- makes a program more robust as it traps the error and outputs a message followed by an orderly shutdown or recovery if possible