Faculty of Engineering and Mathematical Sciences 
Not logged in (login)


This forum is provided to promote discussion amongst students enrolled in Agile Web Development (CITS3403).
RSS cloud
Jump to:

project model-view-controller structure

2 of 419 articles shown, currently no other people reading this forum.
From: Nathan S.
Date: Mon 18th May 2020, 2:07pm


Hi Tim,

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.



project model-view-controller structure

From: Timothy F.
Date: Tue 19th May 2020, 9:32am


Hi Nathan,

No I don't think you shoudl consider refactoring. MVC is typically used for serverside 
rendering. There are client side patterns, like MVVM (Model-View-View-Model), but your 
design sounds fine.
This Page

Program written by: [email protected]
Feedback welcome
Last modified:  9:57am Nov 18 2020