Confusion Implementing MVP in Web Forms

Question

In the context of ASP.NET Web Forms, I have two pages: a form and a list view of some data. Both of these "views" should have a dropdown that is loaded with data depending on what the user is logged into (not all users can see all of the data in the dropdown). In one case, the dropdown is for selecting an item, and in the other, for filtering the list based on that item.

What's the most idiomatic way to design this scenario?

An attempt was made

I currently have:

  • IAuthView

    = an interface that exposes a session token from an ASP.NET page and allows the presenter to set a property User

    that identifies the logged in user
  • AuthPresenter

    = takes a session token and sets the signed user
  • IFormView : IAuthView

    = interface for user logins and event dispatch
  • IListView : IAuthView

    = interface to data list
  • FormPresenter

    = the class responsible for loading data for the form and reading data from the form when the user submits.
  • ListPresenter

    = class responsible for loading the data list and reloading the data when the filter is applied
  • IHasDropdownXView

    = this view describes a dropdown view
  • HasDropdownXPresenter

    = populates a view with a dropdown menu also fetching from the AuthView instance of the subscribed user
  • FormPage : IFormView, IHasDropdownXView

    = loads all three presenters for each view interface that implements
  • ListPage : IListView, IHasDropdownXView

    = loads all three presenters for every view interface it implements

It all seems extremely confusing and complicated for no reason at all. Moreover, it is not clear to me how IHasDropdownXView

should get the user signed up or who should be responsible for collecting all the speakers needed on the last page.

+3


source to share





All Articles