OOP Theory Concepts

studied byStudied by 0 people
0.0(0)
Get a hint
Hint

Three things that define an object

1 / 27

flashcard set

Earn XP

28 Terms

1

Three things that define an object

fields, methods, identifiers

New cards
2

Class

Defines methods and attribute fields that capture the common behaviours and characteristics of objects

New cards
3

Object

Instance of a class

New cards
4

Constructor

Method used to instantiate an object and initialise its attributes

New cards
5

Instantiation

Process of creating an object from a class

New cards
6

Encapsulation

Concept of keeping an object’s data (attributes) and code (methods) within the same unit which is the actual object

New cards
7

Inheritance

Concept where the sub-class can use all attributes and methods from the parent class

New cards
8

Polymorphism

Concept related to inheritance, where a method in the parent class may be redefined to meet the requirements of the sub-class; its identifiers will remain the same

New cards
9

Overriding

Concept linked to polymorphism, in which the redefined method takes precedence over the method with the same name in the parent class

New cards
10

Accessors

Method that allows other objects to obtain the value of instance variables or static variables (getter methods)

New cards
11

Mutators

A method used to control changes to a variable (setter methods)

New cards
12

Association

A relationship between two classes. There are different types of association: composition and aggregation.

New cards
13

Algorithm

A sequence of steps to complete a task that always terminates

New cards
14

Aggregation

A type of association where the aggregated object has a weaker form of association with the objects that it is aggregating than is the case with composition. These objects have an existence independent of the aggregated object and can continue to exist even after the aggregated object is disposed of.

New cards
15

Composition

Forming one larger object from multiple smaller objects, where the smaller objects can’t exist separately from the larger object

New cards
16

Abstraction

The actual method is not supplied in the parent class which means it must be provided in the sub-class. In this case, the object is being used as an interface between the method and the data

New cards
17

Static method

Method that can be used without an object of the class being instantiated

New cards
18

Virtual

A method is defined in the parent class but can be overridden by the method in the sub-class where it will be used. This is a feature of polymorphism

New cards
19

Why is OOP used?

encapsulation, reusability of methods, easier debugging, less error-prone, programmers don’t need to know how the code works, data integrity

New cards
20

Association by aggregation

Concept where one or more attributes inside an object are objects themselves, of other classes; if the container object is destroyed then the contained objects continue to exist

New cards
21

Association by composition

Concept where one or more attributes inside an object are objects themselves, of other classes; if the container object is destroyed, then the contained objects are destroyed

New cards
22

OOP Principle of Design: Encapsulate what varies

Creates as many classes as needed by data/problem

New cards
23

OOP Principle of Design: Favour composition over inheritance

Association is less error prone than inheritance, and enables easier maintenance

New cards
24

OOP Principle of Design: Program to interfaces not implementation

In OOP and interface = methods to be used; when a class is created that adheres to the methods in the interface; when an object is instantiated, it uses this interface because it will use the methods

New cards
25

Recursive techniques

A routine that calls itself for all inputs other than the base case, eventually terminates

New cards
26

Base case

Used to stop the recursion process. When the base case is met the recursion stops and the stack begins to unwind

New cards
27

What is stored in the stack frame at every subroutine call

Values of all local variables, parameters and return address

New cards
28

What is stored in the stack at every recursive call

Values of all local variables, parameters at moment of recursive call, return address

New cards

Explore top notes

note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 57 people
Updated ... ago
5.0 Stars(3)
note Note
studied byStudied by 18 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 1418 people
Updated ... ago
4.8 Stars(25)

Explore top flashcards

flashcards Flashcard29 terms
studied byStudied by 297 people
Updated ... ago
4.5 Stars(10)
flashcards Flashcard50 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard80 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard21 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard144 terms
studied byStudied by 12 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard47 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard49 terms
studied byStudied by 82 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard146 terms
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)