OOP Flashcards

1
Q

What is Programming Model?

A

Programming Model tells you
1️⃣ How to organise the information and processes needed for a solution

2️⃣ Allows/facilitates a certain way of thinking about the solution

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

What are the THREE programming paradigms?

A

1️⃣ <b>Procedural</b>: C, Pascal
2️⃣ <b>Object Oriented</b>: Java, C++
3️⃣ <b>Functional</b>: Scheme, LISO

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

What are the <b>characteristics</b> Procedural language?

A

1️⃣ View program as a process of transforming data

2️⃣ Data and associated functions are separated

3️⃣ Data is <b>publicly accessible</b> to everyone

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

Advantages of Procedural language

A

1️⃣ Closely resemble the execution model of computer, <b>Efficient in execution</b>

2️⃣ <b>Less overhead</b> when designing

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

Disadvantages of Procedural language

A

1️⃣ Harder to <b>understand</b>. Logical <b>relation between data and functions is not clear.</b>

2️⃣ Hard to <b>maintain</b>

3️⃣ Hard to <b>extend/ expand</b>. Affect the current implementation.

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

Main features of OOP

A

1️⃣ Encapsulation
✅ <b>Group data and associated functionalities</b> into a single package.
✅ <b>Hide</b> internal <b>details</b> from outsider.

2️⃣ Inheritance
✅ A way of <b>extending current implementation</b>
✅ Introduce logical <b>relationship between packages</b>

3️⃣ Polymorphism
✅ <b>Behaviour of the functionality changes</b> according to the actual type of data

❌ No direct access to data
✅ Use process to manipulate data

Example: <b>Bank Account Object</b>

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

What are the <b>characteristics</b> OOP?

A

1️⃣ View program as a collection of <b>objects</b>
Perform computation through interaction of objects

2️⃣ Each object has a set of functionalities and data

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

Advantages of OOP

A

1️⃣ Easier to <b>design</b> as it closely <b>resemble the real world</b>

2️⃣ Easier to <b>maintain</b>
✅ <b>Modularity</b> is enforced
✅ <b>Extensible</b>

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

Disadvantages of OOP

A

1️⃣ <b>Less efficient</b> in execution, Further <b>removed from low level execution</b>

2️⃣ Program is usually <b>longer</b> with high <b>design overhead</b>

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

Encapsulation

A

<b>Group data and associated functionalities</b> into a single package.

Separating data (<b>attributes</b>) and functions (<b>methods</b>)

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

Classes

How to define a class? (MUFG)

A

Class = Data + Processes

A class is a user defined data type. Variables of a class are called <b>objects (instances)</b>.

A class contains:

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