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?

20
Q

The const constraint enforced by what?

21
Q

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

22
Q

Const correctness example: what are the following variables:

23
Q

Const correctness example:

24
Q

Const correctness example:

25
Q

Const correctness example:

26
Q

Const correctness example:

27
Q

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

28
Q

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

29
Q

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

30
Q

How are strings the exception to const correctness?

31
Q

What can be const with regards to functions?

32
Q

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

33
Q

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

34
Q

What are const parameters?

35
Q

What is another advantage of accepting const reference parameters?

36
Q

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

37
Q

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

38
Q

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

39
Q

What guarantee does a const function make?

40
Q

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

41
Q

What is conceptual constness?

42
Q

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

43
Q

What keyword is used to allow conceptual constness?

44
Q

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

45
Q

Const function example:

46
Q

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

47
Q

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