samedi 30 janvier 2016

Android MVC realization

I has solid understanding of what MVC is, however it seems like there should be a better way to do it on Android platform. More specifically, I am concerned about activity lifecycle.

Let's say that I have an app that at some point of time should gather data from the Web. And here I have two options : 1) Stick up with self-sufficiency and implement everything in controller's class 2) Transfer all the code into separate classes, something like NetworkWorker.java, therefore implement Single responsibility pattern

First concept is fine, it seems to be solid and independent (like I can copy paste it into a new project and it won't have any dependencies), but I seriously doubt that having 1k+ lines of code in a single file will make it any readable.

Second concept seems fine, as my code will be more readable and easier to modify, plus, considering using multithreading, that seems like the only way to go.

Aucun commentaire:

Enregistrer un commentaire