We finished the bulk of our project a while back, functionally, it works fine. But
it probably doesn't fit into any of these MVC type structures the lectures
described. I am trying to determine right now, how much refactoring of code to do.
After going through the model-view-controller lecture and the latest lecture on
REST, I am not sure. So, the structure of our project is that most of the rendering
is done clientside in js. The models are defined mirroring the DB schema, that is
clear, but the views and controllers are not so clear. The view functinality is
mainly at the client and the controller function is probably split between the two.
What is clear is that the server just authorises the tokens, and talks to the DB.
Description of the functionality:
The initial pages (landing/login/register) are served in a standard way with
render_template, but after login all requests are tokenised GET ajax requests, where
the request context is gained from the token, some GET parameters and the route
(that sounds like a REST API... kind of). The reponse is just a json object
containing the status, template html string and the dynamic content json. The
client then removes all document nodes from the DOM and rebuilds the page with the
new template html (it sounds complicated but it's like one command), then a page
specific function builds the dynamic content (that is your view function). There is
also controller type functionality built into the page, eg. as a student, you click
on a quiz that you have already taken, the js will request a quiz review as opposed
to if you had not taken it yet, in which case, the js would request to take the quiz
instead. That functionality is NOT at the server, as I mentioned before, the server
simply determines if the token is good for the request and then processes it.
So the question is considering the structure is not really conformant to anything
you described, should I spend time trying to split out controller function somehow.
I do not know if that is a good use of my time at this point.