Search code examples
design-patternsmvp

What is the "View" in MVP pattern?


From some tutorials I cant understand what mean "View". More accurately - I cant understand how many views can displays at same time? In tutorials what I read, only 1 view displays at same time, and it always occupies full screen. For example if I need show popup panel, it is normally to make new view for this popup panel? or better to include this popup panel into another view?


Solution

  • You can show as many Views as you need, it is not about MVP pattern. From View perspectives MVP describes relation between Model-View-Presenter, but any View could have child Views with own presenters and bound model.

    So common scenario - having main View which divides own space/layout between set of child views each of them has own Presenter and uses own/shared model (depends on application specifics and design).