|Challanges Implementing MVP [message #1745378]
||Sun, 09 October 2016 11:35
Registered: July 2014
i am currently playing around with implementing Model-View-Presenter in an Eclipse RCP product.
Please consider following story:
- SearchParameterView - Presenter throws Event to trigger search with Parameters entered in ViewModel
- SearchResultView - Presenter listens to searchEvent, gets triggered, searches and updates resultlist in ViewModel, triggers displayEvent to display Details of first Searchresult
- SearchResultDetailsView - Presenter listens to displayEvent, gets triggered and displays what has to be displayed via updating ViewModel so that View gets updated via Databinding
Considering now that this scenario is built upon 3 ViewParts with each having its own Presenter and ViewModel ... i would like to ask some questions:
- is this "a correct design" or did i take some wrong turn wiring the stuff?
- how do i assure that each presenter is active and able to listen to the events all the time? (think of lazy loading a viewpart ... like the non-visible part in a folder of two parts)
- how do i keep presenters clean for testability? - i want to be as rcp-code-free as possible in my presenter but at the same time i want to be able to react to / throw events that interact with other views in the presenter (think throwing/registering for events to/from other presenters)
A little background of things already looked at for inspiration:
- consumed Patric Paulins great presentation concerning his way of organizing/implementing MVP ViewParts/Presenters/Models.
- found someones way of "pre"-wiring viewpart/presenter/viewmodel via some xml configuration which has to be run at the startup of the eclipse.product.
- my own share of experiences concerning lazy loading of eclipse-rcp-elements and examples of databinding viewmodel/presenters or throwing/catching events between presenters
Powered by FUDForum
. Page generated in 0.01813 seconds