jeudi 25 décembre 2014

MVC pattern : some difficulties

In the context of a project, I must implement a card game into java, using MVC pattern. Currently the game is running well on console, but I must add a graphical user interface. I understand well how work controlers and models, but I'm having some difficulties with the view.


You see, i've got many model classes such as "Player" "Card" etc.. which extend from Observable. So as a consequence I suppose I should have a lot of views. But my application will take place in a JFrame object, which would be in a view Class.


My question is : how can all the different views classes have access to the JFrame object (for ex add a button etc..) which is contained in a another view class ? (the JFrame would be in a class such as GameObserver I guess)


Aucun commentaire:

Enregistrer un commentaire