never-go-bad / never-go-bad-android

Android Implementation
0 stars 0 forks source link

Separate Wire model, model and ViewModel #15

Open aoriani opened 8 years ago

aoriani commented 8 years ago

Right now I have two models:

Wire model that represents how data came from network. It may be not the best to work with UI or do any treatment. View model that is used in conjunction with its view to display the data.

The problem is that view model is too tied to its view, so we can't reuse to other views and wire model may be to raw to be useful.

Maybe we should have a intermediary model that allow data to be more consumable than the wire model, but it is generic enough to be used almost in a delegation fashion by other view models, so they only contain UI specific code.

The con is that it imposes more indirection levels, making data flow harder to follow.