MVP Pattern Without History Mechanism?

67 views
Skip to first unread message

Abdullah

unread,
Mar 11, 2015, 3:26:01 AM3/11/15
to google-we...@googlegroups.com
Hi,
  Is any Impact Implementing MVP Pattern Without History Mechanism?

Rogelio Flores

unread,
Mar 11, 2015, 9:51:43 AM3/11/15
to google-we...@googlegroups.com
I don't see any, but also don't see any reason why you wouldn't want to have history support in your app.

Abdullah

unread,
Mar 11, 2015, 10:12:29 AM3/11/15
to google-we...@googlegroups.com
Because of History Mechanism,When Switching from one Screen to other screen i need to pass some data to that Screen that i am unable to achieve using History Mechanism.Will it possible to pass the data?Is there any example code?

Greg

unread,
Mar 12, 2015, 7:11:32 AM3/12/15
to google-we...@googlegroups.com
When passing the state of the screen in the url you shouldn't embed whole data in it. Instead you should pass some references to it like ids etc. The screen you want to display should use that references to fetch the actual data (from LocalStorage / IndexedDB / Server)
Message has been deleted

Ümit Seren

unread,
Mar 12, 2015, 9:50:12 AM3/12/15
to google-we...@googlegroups.com
This is an anti-pattern.
You should make sure that all screens that can be navigated to by the user are stateless in the sense that all the state can be derived from the URL. 
The big advantage is that the screen can be bookmarked users can navigate to it directly.
If you are concerned about redundant backend calls encapsulate the backend calls in a seperate (singleton class) that handles caching. This will also reducate the logic in your Presenters because you don't have to check the URL parameters against the already fetched data. 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages