jeudi 30 avril 2015

Presenter, View, extendable objects

I faced problem in code architectures. I have object, movie (movie has name, and list of pictures) and I have nested views for example:

view1 -> view2

In view1 presenter loads movie by id, receiving movie(id,name). And another presenter in view2 loads list of pictures by movie id and view2 only know about this pictures.

But know I need to show new view from view1 (view1 does not know anything about images yet), and so there is several ways:

  • load all data from main view (view1) using presenter in view1 and pass it to view2
  • create method in view2 for getting list of images by call from view1
  • extend movie model class or convert movie to movieEx (for example) and add list of images to it after loading.

What do you think about most appropriate solution?

Aucun commentaire:

Enregistrer un commentaire