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 2

Expand layers, part 2 - Android Tutorial

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

Start my 1-month free trial

Expand layers, part 2

- [Instructor] Let's go ahead and go back into our ModelLayer and continue implementing this persist JSON method, so in here we've converted these. We should know have a list of dtos. Go ahead and collapse this panel to give us a little more room and we're going to use our Threading library, just to trigger this block on another thread. And in here we're going to say dataLayer.clearSpies, just like we were before, make this a public method. It wants our block, go ahead an end that. And in here, we're going to say dtos.forEach(dto -> dto.initialize());. And that just sets up the image id from the image name. And then we're going to make a translator. We'll just say tranlastionLayer.translatorFor(DTOType.spy). In fact, we should move this to our Spydto. Make this just a public static bar. We'll call this dtoType = DTOType.spy;. Come back into here and we'll just say (SPYDTO.dtoType); let's make a translator. And then with that translator, we'll say dataLayer.persistDTOs(dtos…

Contents