Question
In the context of ASP.NET web forms, I have two pages: a form and a list view of some data. Both of those "views" need to have a dropdown that is loaded with data depending on what user is logged in (not all users can see all data in the dropdown). In one case the dropdown is for selecting an element and in the other to filter the list based on that element.
What's the most idiomatic way of architecturing this scenario?
There was an attempt
What I currently have is:
IAuthView= interface which provides the session token from the ASP.NET page and allows a presenter to set anUserproperty which defines the logged userAuthPresenter= takes the session token and sets the signed userIFormView : IAuthView= an interface to the user inputs and submit eventsIListView : IAuthView= an interface to the list of dataFormPresenter= the class responsible to load data for the form and read data from the form when the user submits.ListPresenter= the class responsible to load the list of data and reload the data when a filter is appliedIHasDropdownXView= this view describes a view that has the dropdownHasDropdownXPresenter= populates the view with the dropdown also fetching from the AuthView instance the signed userFormPage : IFormView, IHasDropdownXView= loads all three presenters for each view interface it implementsListPage : IListView, IHasDropdownXView= loads all three presenters for each view interface it implements
This all seems extremely convoluted and complicated for no reason. Moreover it's not clear to me how the IHasDropdownXView should fetch the signed user or who should be responsible to assemble all presenters required in the final page.