On Tue, Jun 19, 2012 at 9:44 PM, Walter Bishop <[email protected]> wrote:
> For example, let's imagine that I have an application that has a
> background service periodically firing to downloading images, when an
> image is retrieved the user is notified. On the other hand the user
> can click on a button and launch an asynctask to download a particular
> image.
>
> I believe this situation follows the MVC model:
>
> - View, corresponds to the activity which in turns is linked with the
> layout (perhaps modelview? and instead of MVC is MVVM?). When the user
> clicks on the button it communicates with via async task with a
> controller.
>
> - Controller, corresponds to a class that extends application and
> works as a manager, depending on the activity request it communicates
> with the delegates the request to the corresponding class, in this
> case the one which will retrieve that image. When the download is
> finished it notifies the activity via broadcast. The service also
> communicates with this manager.
>
> - Model, corresponds to broadcasts that are made from the application
> to the activity warning it that new data is available.
>
> Is this correct?

To you, yes. And, since everyone can have their own opinion on this,
your opinion is as valid as anyone else's. Android is not expressly an
MVC environment, and any attempt to force-fit it to MVC is going to
make approximations.

Personally, I consider a basket of widgets to be the view, the
fragments and their hosting activities to be the controller in
aggregate, and the model to be whatever the app needs (POJOs,
database, etc.). But, that's just my take on it.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in DC: http://marakana.com/training/android/

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to