Model – View – Controller Introduction, Lecture notes of Web Application Development

MVC Concepts - MVC Pattern Explained –Overview, Purpose • Web App Structure – Front Controller – Data Processing Design pattern with three independent components: – Model (data) • Manages data and database logic – View (UI) • Presentation layer (renders the UI) – Controller (logic) • Implements the application logic • Processes user request, performs an action, updates the data model and invokes a view to render some UI

Typology: Lecture notes

2020/2021

Uploaded on 05/11/2022

huy-cung
huy-cung 🇻🇳

5

(1)

32 documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MVC Introduction
Model View Controller
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download Model – View – Controller Introduction and more Lecture notes Web Application Development in PDF only on Docsity!

MVC Introduction

Model – View – Controller

  • MVC Concepts - MVC Pattern Explained
    • Overview, Purpose
  • Web App Structure
    • Front Controller
    • Data Processing Table of Contents 2

MVC Concept Explained User /Some/Page/

Controller

HTTP Request

Front controller

(dispatcher)

Model

(data)

View

(render UI)

HTTP Response Delegate request Select view & pass data Use data from the model CRUD operation s

  • Design pattern with three independent components:
    • Model (data)
      • Manages data and database logic
    • View (UI)
      • Presentation layer (renders the UI)
    • Controller (logic)
      • Implements the application logic
      • Processes user request, performs an action , updates the data model and invokes a view to render some UI The MVC Pattern 5
  • Defines how the application’s user interface (UI) will be

displayed

  • May support master views (layouts)
  • May support sub-views (partial views or controls)
  • May use templates to dynamically generate HTML View (UI) 7
  • The core MVC component – holds the logic
  • Process the requests with the help of views and models
  • A set of classes that handles
    • Communication from the user
    • Overall application flow
    • Application-specific logic (business logic)
  • Every controller has one or more "actions" Controller (Logic) 8

Web and PHP App Architecture 10 Views: HTML + PHP PHP Model Classes PHP Data Access Classes Web Browser MySQL PHP Controller Classes Presentation Business Logic Data Access Layer Web Browser Database Presentation Logic

MVC Collaboration Diagram

Simple MVC Folder Structure

index.php

Book.php

Model.php

viewbook.php

Booklist Page