Answer the question
In order to leave comments, you need to log in
How to implement persistent data access in MVP design pattern?
In the application I'm developing, each screen needs user data. Initially, it was planned to simply create a User class that would be created as needed in the necessary Presenters, but doing this in each of them again seems like a big mistake. How would you get out of this situation?
The User class contains the User model, from which it receives all the data.
Answer the question
In order to leave comments, you need to log in
I don't think referring to the model inside the User is a good idea.
The User object can be created in the model and requested by the desired presenter, which will already pass it to the view. The model itself may well be a singleton and store a reference to the User object, so as not to create it every time anew.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question