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, part 3 - Android Tutorial
From the course: Android App Development: Design Patterns for Mobile Architecture
Expand layers, part 3
- [Voiceover] We've made those changes within in the data layer and we've extracted everything out to their separate layers, but let's go through the presenters and make sure that they are using things correctly. We're going to copy this model layer, go to our other presenters, and just make sure that we're using that instead of any realm instance. And we're going to go into the constructor, and really we just need to get rid of this data method here. It doesn't belong here. We'll have one of those in the details presenter as well. And then I'll kind of dictate what we need to do. Remove any concrete instance of a data layer. So, within this SpyDetailsPresenter, instead of getSpy, we'll say modelLayer.spyForId, and we'll say spyId. Come down to here to make sure that this method exists. And in here we're just going to use that data layer, return dataLayer.spyForId and pass in that ID. And that should be fine here. We'll need to do the same thing for the SecretDetailsPresenter. In this…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.