0

I am trying to understand MVC pattern correctly.

I am using Java and JFS, which means that each HTML page is linked with back-end Java View class. Then View class calls Controller to retrieve some data. Controller use Data class if needed. For me it is logical and seems like it is described in this way on this image:

enter image description here

But on this Image I can see another situation, when a front-end HTML calls a Controller class, which is not logical for me.

enter image description here

Both images are taken from here, but other resources gives me the same confusion.

Please, advice where do I have wrong understanding and what should I read to understand it correctly ?

1 Answers1

0

Let me give you my own understating of MVC may be it will help you too.

Modal -> Contains functions process data which comes from the database (Note it is not the actual database. It's just like a shop keeper who knows that when you buy something they are surpossed to pack it for you )

Controller -> If you get data from a user e.g passwords and you are surpossed to checkin if it has a certain chararcters. Functions that are surpossed to do that are the controllers. (Note you could do both Controllers and views in the same place but we divide it to simplify work.)

views -> Views are just like redirectors to the controllers that are surpossed to process what ever the user requests for.

So actually in your second image the requests and response from the browser should be pointing to the views.

iamafasha
  • 848
  • 10
  • 29