I'm starting to learn to program and I created a simple BlackJack console game. Now I'm trying to create a GUI using swing/JFrame and decided to try and learn basics of MVC at the same time. I came across this java / gwt UI coding - clean code about MVC
My questions is how exactly should the View be notified of a change to a players hand after they hit "hit."
If user wants to hit, hitBtn(in VIEW) -> actionListener()(in CONTROLLER) -> hit()(in MODEL)
- hit() would than modify the nessessary model classes
(i.e. DealtCards, Deck, Cards objects)
How should the view know the Model has changed and more basically how should the View display the data in the model classes, for example the players hand?. Using getter methods in the model classes or a pass through from Model to Controller to View? (I'm under the impression the View shouldn't have any reference to the Model)
Thanks!