I'm making a Servlet application using the a MVC-like implementation, however I'm slightly confused on how I should delegate concurrent modification of the state of the Model object?
I intend to use a database to hold information from a given session for a particular individual (the data will be retrieved based on a username and password).
It doesn't seem possible or practical to store a Thread in the Model object, so that's really not an option.
I do want to respect the MVC implementation such that the View is dependent on the Model object and the Controller changes the state of the Model.
The question is, how do I make the View update when the Model changes state? The View is going to be a JSP that has action-value attributes. Since the View is really just a page (and not an object), how do I tell the page to refresh based on the new information? Must I rely on the Controller to do so?
I understand that Servlets run in a multi-threaded server environment, though I'm not sure how this is exercised upon the model. It seems like a waste to force the page to be refreshed every millisecond (and potentially costly to the client), though I don't understand any other way for the type of program I wish to write.
To be slightly more specific, I'm planning on remaking Snake-it in a Servlet environment as a practice program for JSP and Servlet programming. The information will be stored in a database for a given session.
Any feedback would be appreciated. Thank you.
-Alex