• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this a design flaw?

 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I noticed that I am fetching the lists of carriers and origin/destination locations prior to setting up the MVC model. I detect the config parameters like path (depending on what mode is selected) to the db.db and then my listener class creates my controller, data and views.
I am starting to wonder if this is correct to do some thing like this-
// get the location lists to populate the View
list1 = dataFacade.retrieveListOfLocations();
list2 = dataFacade.retrieveListOfCarriers();
while setting up the MVC. I am asking this question because these calls are essentially RMI server interface calls, yet they do not go thr' the controller. In every other case, my Controller listens to an action, calls a method on the DataFacade that talks to the remote server. When the data becomes available, the Model (DataFacade in this case) fires an event and all it's observers get it.
Help!
Aruna
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it is kind of hard to comment on whether it is right or wrong. If you put it after the GUI class gets instantiated then you can assign the values to your drop down, if you have one, and then all the code regarding the drop downs (getting and assigning the data) at the same time, which can be thought of as easier to read, and can be placed in it's own method, so that that method is responsible for that one thing alone.
But I can't completely say you are wrong and to rework it.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic