Design Patterns & Const Correctness Flashcards

1
Q

What is a design pattern?

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

What is the process of discovering a design pattern?

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

What is the process of applying a design pattern?

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

What are the four main components of design patterns?

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

What are some of the details of design patterns?

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

What are the three main types of design patterns?

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

What is the “Gang oof Four Design Patterns”?

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

What are the benefits of Design Patterns?

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

What are the Drawbacks of Design Patterns?

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

What is the Model-View-Controller design pattern?

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

What is the Model portion of the MVC design pattern?

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

What is the View portion of the MVC design pattern?

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

What is the Controller portion of the MVC design pattern?

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

MVC design pattern diagram:

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

What is the Model View Presenter design pattern?

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

What are the benefits of the MVC design pattern?

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

What are the two main goals of creational design patterns?

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

With creational design patterns, the system at large knows about what?

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

What are some of the creational design patterns?

A
20
Q

The const constraint enforced by what?

A
21
Q

What is the ‘right-to-left’ rule for pointers and const?

A
22
Q

Const correctness example: what are the following variables:

A
23
Q

Const correctness example:

A
24
Q

Const correctness example:

A
25
Q

Const correctness example:

A
26
Q

Const correctness example:

A
27
Q

When the data pointed to is constant, where does the ‘const’ need to go?

A
28
Q

Can an address of a non-const object be assigned to a const pointer?

A
29
Q

Can you assign the address of const object to a non-const pointer?

A
30
Q

How are strings the exception to const correctness?

A
31
Q

What can be const with regards to functions?

A
32
Q

What is a const return value? Why would you return a const value?

A
33
Q

What do we almost always want to return as a const?

A
34
Q

What are const parameters?

A
35
Q

What is another advantage of accepting const reference parameters?

A
36
Q

What is a const function? What is the difference between a const function and non-const function?

A
37
Q

What really happens when we call a function on an object? How does a const function apply to this?

A
38
Q

Why does having a function be const prevent the private data from being changed?

A
39
Q

What guarantee does a const function make?

A
40
Q

What does it mean for a member function to be const? What is the difference between bitwise constness and conceptual constness?

A
41
Q

What is conceptual constness?

A
42
Q

How the the length() function an example of conceptual constness?

A
43
Q

What keyword is used to allow conceptual constness?

A
44
Q

What do const member functions specify? Members functions differing only in their constness can be…

A
45
Q

Const function example:

A
46
Q

In what situations should a pointer or member function be declared const?

A
47
Q

What is the rule of thumb for const functions? How can it help software?

A