Thread
#android-architecture
    Joey

    Joey

    2 years ago
    Hi guys, just a quick question. If i pass a variable from the model to view via presenter. Does it violate the rules of MVP? Thanks!
    Anastasia Finogenova

    Anastasia Finogenova

    2 years ago
    This idea "smells" a bit 🤷
    Maybe if you describe the use case people can suggest a better way
    s

    Sagar Suri

    2 years ago
    View should only get state/data which it can directly show to the user. So when you pass data from model to presenter, you transform that data to either a particular UI state or something that can be directly used by the view to render.
    Joey

    Joey

    2 years ago
    Got this
    Thanks guys! @Anastasia Finogenova @Sagar Suri
    Ivann Ruiz

    Ivann Ruiz

    2 years ago
    Instead of passing a reference to the View from presenter you could use the Observer pattern to react to changes in the data. We're currently using the latest from Architecture Components (
    ViewModel + LiveData
    ) and it works really well! You can always use rxJava and access
    Observables
    in the presenter from
    View
    .