ItsMeBrianD / Percival

SpaceX Data Aggregator
0 stars 0 forks source link

Discussion: MVC in Views/Launch/ files #2

Open jaller94 opened 5 years ago

jaller94 commented 5 years ago

As far as I can tell the files in ´Views/Launch/´ don’t follow a strict Model View Controller (MVC) pattern.

It’s loading data (task of a controller), storing it in a global variable ajaxRequests (the model) and writing it into the DOM (task of a view). This all happens in one file and the MVC components are not split into different files or marked by inline comments.

While this is a valid practice, the view code is not clearly separated in M, V, and C. Furthermore, MVC wants data binding. This requires that the view observes the model for changes and updates itself when new data becomes available.

I see that you mainly regard the backend code to follow the MVC pattern. Is your front end code deliberately exempt from this?

ItsMeBrianD commented 5 years ago

Because it was a project requirement to use Kendo UI, and because Kendo UI primarily handles the API calls, there was little data left for the view to model. Also, due to the nature of the data (SpaceX Launch Information), real-time updating isn't practical.

This is my first interaction with this structure (my other web-based work is mostly Flask, which doesn't strictly follow an MVC paradigm), so I'm getting accustomed to how to make this integration between back-end and front-end, especially when the data is loaded into the front-end, rather than in the back-end and passed to the front.