+ All Categories
Home > Software > Architecture logicielle #4 : mvc

Architecture logicielle #4 : mvc

Date post: 27-Jul-2015
Category:
Upload: jean-michel
View: 151 times
Download: 4 times
Share this document with a friend
Popular Tags:
16
Architecture logicielle : MVC
Transcript
Page 1: Architecture logicielle #4 : mvc

Architecture logicielle : MVC

Page 2: Architecture logicielle #4 : mvc

1. Theory

Page 3: Architecture logicielle #4 : mvc

Real MVC vs Fake MVC

Page 4: Architecture logicielle #4 : mvc

Fake MVC

MVC is a software architecture that separates business logic from the rest of the user interface. It does this by separating the application into three parts: the model, the view, and the controller.Source : Dave Jarvis, http://programmers.stackexchange.com/questions

Page 5: Architecture logicielle #4 : mvc

Fake MVC - Components & collaboration

User

Controller

ViewModel

HTTP

HTML

RenderAsk

Datas

Page 6: Architecture logicielle #4 : mvc

Real MVC - definition

Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.Source : http://en.wikipedia.org

Page 7: Architecture logicielle #4 : mvc

Real MVC - Components & collaboration

User

ControllerView

Model

UsesSees

Updates Manipulates

Page 8: Architecture logicielle #4 : mvc

Le Model

Game of thrones - The wall

Page 9: Architecture logicielle #4 : mvc

Rôle du Model

Gérer le stockage des données

Assurer l’intégrité des données

Répondre aux requêtes du controller

Notifier les changements d’états

Page 10: Architecture logicielle #4 : mvc

La view

Game of thrones - Final Season 3 Scene

Page 11: Architecture logicielle #4 : mvc

Rôle de la view

Afficher les données

Gestion du format d’affichage

Gestion de la logique d’affichage

Page 12: Architecture logicielle #4 : mvc

Le controller

Game of thrones - The Iron Throne Room in King's Landing

Page 13: Architecture logicielle #4 : mvc

Rôle du Controller

Traiter les interactions avec l’utilisateur

Collecter les informations pour le Model

Charger et alimenter la view

Page 14: Architecture logicielle #4 : mvc

2. Practice

Page 15: Architecture logicielle #4 : mvc

Exemples d’implémentation PHP

http://www.sitepoint.com/the-mvc-pattern-and-php-1/

https://blog.udemy.com/php-mvc-framework-tutorial/

http://anantgarg.com/2009/03/13/write-your-own-php-mvc-framework-part-1/

https://github.com/panique/mini

Page 16: Architecture logicielle #4 : mvc

To be continued …


Recommended