Design question about layers and MVC
-
Hello all. I have this 3 layer application I'm building (with MFC as my Framework). I'm trying to follow the MVC pattern. For some actions, the controller will request the view to get some input from the user, usually by displaying a dialog box. This dialog will usually be populated with drop-down lists that are not directly related to the model, however they are essential as they allow some filtering. Say, the Product Family drop-down will be filtered according to the value selected in the Branch dialog. A Product has a Product Family, and a Product Family has a Branch associated (and thus, the Product has a Branch associated as well). My question is the following. I was wondering whether the controller should provide the dialog with the Branch collection, or rather the dialog box should simply load the branches and display it. Any clue will be really appreciated, as I'm having trouble to determine which one would be the best option. Thanks in advance.
Stupidity is an International Association - Enrique Jardiel Poncela
-
Hello all. I have this 3 layer application I'm building (with MFC as my Framework). I'm trying to follow the MVC pattern. For some actions, the controller will request the view to get some input from the user, usually by displaying a dialog box. This dialog will usually be populated with drop-down lists that are not directly related to the model, however they are essential as they allow some filtering. Say, the Product Family drop-down will be filtered according to the value selected in the Branch dialog. A Product has a Product Family, and a Product Family has a Branch associated (and thus, the Product has a Branch associated as well). My question is the following. I was wondering whether the controller should provide the dialog with the Branch collection, or rather the dialog box should simply load the branches and display it. Any clue will be really appreciated, as I'm having trouble to determine which one would be the best option. Thanks in advance.
Stupidity is an International Association - Enrique Jardiel Poncela
Seems like you have a Push or Pull quandry as examined, for example, here[^].