From the course: Android App Development: Design Patterns for Mobile Architecture

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Expand layers

Expand layers - Android Tutorial

From the course: Android App Development: Design Patterns for Mobile Architecture

Start my 1-month free trial

Expand layers

- [Instructor] So, we pushed all the logic into each of the presenters, but that doesn't do us a lot of good. There's still a lot of duplicated code as well as we aren't getting any benefits from isolating this logic into separate layers. So let's go ahead and break out the logic that doesn't belong in the presenter, and start putting it into the different model layers. So, we have this model layer, and we know that it's responsible for data objects, for a network, for translation. Let's go ahead and make an actual class named Model Layer. You can call it whatever you want, it's the interactor, it could be Model Manager, it could be anything. The important part is that we're breaking this into these layers, and that we're using some sort of layer, or class, that manages the access to all of the different data processes. We're abstracting that from the presenter. So, we'll call this Model Layer. We'll come back into our presenter, and we'll give ourselves an instance of this model…

Contents