After moving all the non-view logic into the presenter, the next step is to move those groups of logic into their own respective layers. Most of these Layers are going to be below a Model Layer. The Model Layer's responsibility is to use the different Data Layers (Network, Database, Translation) and return the result - it just simplifies what the presenter needs to ask for. The presenter's responsibility is to ask for the data, apply any specific business transformations on that data, and hand it to the view layer.
- [Instructor] We've moved out of the logic…into the presenters,…and now the next step is to move that logic…into the real layers that it belongs to.…The networking code in the networking layer,…the database code in the database layer,…and any translation stuff within a translation layer.…So, the first thing we're going to do is create classes…to put those in, and groups to put those classes in.…So within our model layer,…we have a network in a database layer.…Let's create a group,…and we'll name this Translation.…
And in here, we're going to create a translation layer.…So New File, it's a Swift File,…and we'll just say TranslationLayer.…And in here we'll say class TranslationLayer.…We'll also do this for the Database.…Say New File, Swift File, and DatabaseLayer,…class DatabaseLayer,…and also the Network Layer, NetworkLayer,…class NetworkLayer,…and then we'll make a model layer,…which all of those other pieces will belong to.…
Now that model layer could be your interactor,…it could be a model manager,…you could call it whatever you want,…
Author
Released
6/27/2017- Moving pieces of architecture
- Designing an MVA app
- Walking through a demo application
- Converting to MVP
- Moving non-view logic to a presenter
- Breaking logic into layers
- Using entities
- Setting up dependency injection
- Implementing the coordination pattern
- Adding data binding with RxSwift
Skill Level Intermediate
Duration
Views
Related Courses
-
Introduction
-
Welcome48s
-
-
1. Moving Pieces of Architecture
-
Why architecture?3m 32s
-
Architecture pieces2m 19s
-
Common architectures3m 42s
-
-
2. Demo Application Walkthrough
-
UI overview41s
-
Code overview1m 18s
-
Load data2m 51s
-
-
3. Convert to MVP
-
Create presenter3m 14s
-
Create presenter, part 23m 28s
-
Create presenter, part 32m 36s
-
Create presenter, part 43m 21s
-
-
4. Expand Layers
-
Expand layers5m 59s
-
Expand layers, part 24m 14s
-
Entities2m 49s
-
-
5. Dependency Injection
-
Swinject overview6m 27s
-
Swinject storyboard3m 14s
-
Presenter conversion5m 45s
-
Protocol injection8m 53s
-
-
6. Navigation Coordinators
-
Coordinator walkthrough3m 15s
-
-
7. Data Binding
-
RxSwift – observables11m 15s
-
RxCocoa – data binding6m 46s
-
-
Conclusion
-
Next steps42s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Expand layers