0

This is my first post here. If i'm doing something wrong, please tell me.

I want to create a Menu in Java with MVC pattern without JavaSwing, so with a View that only prints. My program has a Model which generates Runnable tasks. So when the Controller recives numeric input from the user, it communicates this input to the Model, so the Model knows what tasks has to be performed. The problem is: these tasks do some actions, including lots of printings mixed with user input requests. Asking for input and printing is not what Model is created for. So, how can I handle this? I want my classes respect their responsibilities. Thank you.

Stefano
  • 13
  • 5
  • Whether you are using Swing or not, the controller is responsible for carrying out the actions of the menu items. The model should provide information (like menu item text) which the view uses to create a display. The model should not provide the actions. – VGR Nov 04 '21 at 14:52
  • Oh...I feel stupid. You are totally right. Thank you. – Stefano Nov 04 '21 at 16:42

0 Answers0