0

Hello. I have a project for queues simulation to do and I have to follow the MVC pattern. My classes until now are: Client, Queue which represent the Model, Controller, GUI which is the View, and the Main class. If I have those 2 classes representing the Model, how should I use them in the Controller class? Or I should make another class Model?

2
Contributors
4
Replies
26
Views
4 Years
Discussion Span
Last Post by lauraroxi
0

Your model may consist of many classes working together - most models do. Similarly the view will almost certainly need quite a few classes

0

I understand, but then how I should work with the classes that represent the model in the controller class? Should I have another class which initializes the model with the values from the view, or should I simply use the 2 classes representing the model in the view?

1

There's no one "correct" answer. In simpler cases the controller initialises a model, then initialises the GUI and passes it a reference to the model. The GIU can then interact directly with the model. In more complex systems the controller plays a bigger role in mediating the GUI/model interactions and hiding each side's complexity from he other side. My guess is that for a college project the first approach will probably be easier.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.