vendredi 10 juillet 2020

Does MVC pattern implement common tasks of web framework?

The common tasks of web application framework(ex: Django or Laravel or .NET):

request / response abstraction 
session state 
user authentication & authorisation 
page templating 
URL mapping 
DB access 
security 
caching

To implement above common tasks, MVC design pattern handles these tasks, as shown below:

  1. URL mapping is handled by Controller of MVC. Controller routes requests to handlers. Ex: http.ServeMux is the controller from GOLang package

  2. request / response abstraction is performed by Controller by registering the handlers, written by web developer, as shown below:

    sm := http.NewServeMux()     // in GoLang
    
    sm.Handle("/", productHandler)
    
  3. session state is handled by the handler code written by web developer

  4. Page templating is handled by templating engine(view component) of MVC

  5. user authentication & authorisation is handled by the handler code written by web developer

  6. DB access is handled by model component of MVC.

  7. security and caching is handled by handler code written by web developer


Is this the right understanding on MVC design pattern to implement common tasks of web application framework?

Aucun commentaire:

Enregistrer un commentaire