Beyond MVC. Design Pattens, Architecture, FRP, and Dependencies Management. Flashcards

1
Q

What design patterns are commonly used in iOS apps?

A

MVC, Singleton, Delegate, Observer

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

What is MVC?

A
  1. Models being NSObject subclasses or Core Data objects
  2. Views being UIView and UIViewControllers that draw things on screen
  3. Controller being application’s logic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

MVC: Avantages

A
  1. Some architecture is better than none

2. It’s simple to understand and even novice developers can wrap head around

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

MVC: Disadvantages

A
  1. View controllers tend to be abused and given too much responsibility
  2. Falls short in edge cases. Where do you put a service object that does HTTP networking?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

MVC: Alternatives

A
  1. MVVM can help extract some business logic and data out of view controllers and into view models
  2. SRP helps with setting firm boundaries for your code for object responsibilities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is MVVM?

A
  1. A subset and extension of MVC
  2. Adds View models that play an important role in data presentation and delegating business logic triggered by the view layer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

MVVM: Advantages

A
  1. fits nicely into existing MVC architectures
  2. more testable
  3. state decoupling, responsibility decoupling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the common layers of responsibility that an iOS application has?

A

UI Layer
Service Layer
Storage Layer
Business Logic Layer

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

What is the UI Layer responsible for?

A

Display UI elements on the screen and take user input in and delegate to rest of your app

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

What is the Service Layer responsible for?

A

All external communication your application has. ex: HTTP API client

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

What is the Storage layer responsible for?

A

Ultimate source of truth for the application

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

What is the Business Logic Layer?

A

Objects that use components and objects from other layers to achieve results and work for the user

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