Bookmark Topic Watch Topic
  • New Topic

A (couple) quick question(s) on MVC DAO

 
Geoff Berl
Greenhorn
Posts: 24
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks for the clarification, now that I think of it I'm not sure why I asked if the Model set the view's data. The intent behind MVC is to be able to reuse the model for any view which obviously wouldn't work if I programmed it to set component values in any particular view.

Yeah, the reason I say I've been working on understanding it for the past few days is because there are so many different variations, every time I tried to implement one, I would run into an issue and google it only to end up finding something somewhere that contradicted the original paradigm I was going with. I ended up figuring out that no one in particular was right but I chose to go with one where the model and view can only communicate via the controller, there is no path from view to model directly in either direction. To me this seems the easiest to start with, then I may venture into the ones that have the view call to the model for updates as I've seen in some implementations.

I do have one more question if you don't mind...

During the initial start up of the application I want my controller to populate the combobox in my view. Normally my controller get's the combobox component via the listener. How "should" my controller access this component when it isn't event driven? Currently I have created a method in the view like this

I didn't copy that directly so it may not be syntactically correct but you get the picture.

Is this a typical way to perform an action like this? I've also seen something like this
in which case the controller would get the JComboBox and work with it in the controller but that doesn't seem right.

In that case why wouldn't you just make jcbEmployees public, which also doesn't seem right?
 
Geoff Berl
Greenhorn
Posts: 24
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
My apologies, this was supposed to be a reply to my original thread "A quick question on MVC (DAO)" Somehow it ended up as a completely new topic. Can this be joined or is it completely messed up now?
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Report post to moderator
or is it completely messed up now?

It's all gotten really messed up. You can remove your shoes now and stand in line to wait for your turn to be defenestrated.
Don't forget to fill in the forms indicating clearly where you want your kidneys and other internal organs to be donated.

P.S I think if you hit the "report" button the moderators will see your request quicker and they might be able to merge the threads (and delete my post)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
While we don't have an automated way of merging threads, I copied your post into the other thread. And am closing this one.

And yes, either of you clicking "report to moderator" will get someone to see if faster.
 
    Bookmark Topic Watch Topic
  • New Topic