2

To the experts, is it designed by following the MVC approach or is it just procedural programming that separates logic and views?

4

I'm not an expert, but apparently it's supposed to be applying MVC. I think the idea behind MVC is dividing the website/web application into 3 interconnected parts.

  1. The model (e.g., the database)
  2. The view (e.g., the files under templates)
  3. The controller (e.g., the files under public)

And the reason behind this, as this article suggests, is to separate internal representations of information from the ways that information is presented to or accepted from the user.

enter image description here

As you can see in the image above, the user sees the view (e.g., the files under templates) and uses the controller (e.g., the files under public) which manipulates the database which in turn gets the view updated.

You may check out this article for more details!

Hope that helps!

10
  • I don't think the model is directly updating the view here :( – user1502178 Aug 26 '14 at 13:03
  • @user1502178 as I mentioned, the model represents the database. Databases are only capable of storing and organizing data. They're not capable of controlling your program. The controllers are the ones that are capable of managing the communications between the view and the model. I just edited the image above because it's a little bit confusing and added a link to an article that explains this in more detail. – kzidane Aug 26 '14 at 15:34
  • This is quoted from the wikipedia article, "The central component of MVC, the model, captures the application's behavior in terms of its problem domain, independent of the user interface. The model directly manages the application's data, logic and rules." But in this case, the model is neither capturing the problem domain nor directly manages the logic and rules. – user1502178 Aug 29 '14 at 5:08
  • @user1502178 which of these do you think is responsible for managing data and forcing the logic and the rules? Any attempt to insert invalid data into the database will get refused. This is how the database forces the rules. – kzidane Aug 29 '14 at 11:03
  • clearly the files under /public are managing all the logic which according to you play the role of the controller. – user1502178 Aug 29 '14 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .