4.1.2 FoP (Programming Paradigms) Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is meant by a Class

A

Software blueprint or template for implementing objects of a given type which specifies that data fields and methods that objects will have

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Object

A

An instance of a class, that has a collection of of data fields and methods that operate on these data fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by the term Encapsulation

A

The practice and ability to hide or isolate the internal components (data) and operations (methods) of an object, allowing the user only to communicate only through the public interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is it meant for an object to be ‘black-boxed’

A

If an object is properly encapsulated, it will only reveal the information needed to reuse its members through the public interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is meant by the term inheritance

A

The relationship among classes wherein one class shares the data structure and behaviours of another, meaning it has the same properties and methods as its parent class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is meant by Polymorphism

A

It refers to the programming language’s ability to process objects differently depending on class or data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Inheritance based Polymorphism

A

A situation when the method in the base class is inherited in the derived class, but is redefined to suit the data and purpose of the derived class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is meant by Method Overloading

A

When multiple methods in the same class have the same name but a different parameter list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is meant by Overriding

A

Methods will allow a derived class to alter the behaviour that is inherited from the base class, whilst maintaining the same method call and signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Interface based Polymorphism

A

When an interface is created and is implemented differently in several classes, making the method call the same but the algorithm potentially differently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is meant by Aggregation

A

When an object may be built up from other objects, and is based on the way in which objects are related

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Association Aggregation

A

When an object has a relation but no dependency on the existence of another object (if one is destroyed the other still exists)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Composition Aggregation

A

When an object has a relation an dependency on the existence of another object (if one is destroyed the other no longer exists)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the three Advanced Design Principles

A
  • Encapsulates What Varies
  • Favour Composition over Inheritance
  • Program to interfaces, not Implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does it mean to Encapsulate What Varies

A

The idea that where there is a variance, there should be a class for it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does it mean to Favour Composition Over Inheritance

A

Instead of building complex inheritance hierarchies, programmers should create stand-alone classes that combine with other classes to produce efficient code.

16
Q

What does it mean to Program to interfaces, not implementation?

A

Allows programs to be written based on interfaces as opposed to each individual implementation of a class. This allowsus to alter individual classes without directly affecting the class, by modifying the functionality, with reference to the interface