Design Patterns by Tutorial Flashcards

1
Q

What is a design pattern?

A

Reusable, template solutions to common development problems

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

What are the 3 main types of design patterns?

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

What are structural design patterns?

A

Describes how objects are composed and combined to form larger structures.

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

What are some examples of structural design patterns?

A

MVC, MVVM, Facade

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

What are behavioral design patterns?

A

Describes how objects communicate with each other.

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

What are some examples of behavioral design patterns?

A

Delegation, Strategy, Observer

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

What are creational design patterns?

A

Describes how to create or instantiate objects

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

What are some examples of creational patterns?

A

Builder, Singleton, Prototype

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

What are some benefits of using design patterns?

A
  1. Create a common language
  2. Fast-track developer onboarding
  3. Allow to spot similarities between code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

MVC: What are Models?

A

hold application data. Usually structs or simple classes.

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

MVC: What are Views?

A

display visual elements and controls on screen. Usually subclasses of UIView

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

MVC: What are Controllers?

A

coordinate between models and views. They are usually subclasses of UIViewController.

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

How does ownership and data flow through MVC?

A

The ViewController owns both the Model and View. Views pass information back through actions. Model through property observers.

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

When should you use MVC?

A

Use MVC pattern as a starting point for creating iOS apps.

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

What are some limitations to MVC?

A

Not every object will fit neatly into a category of M, V, or C. “Massive View Controller”

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