Powerpoint Presentation On MVC Architecture
Powerpoint Presentation On MVC Architecture
MVC(Model-View-Controller) Architecture
Presented by:
Model – this part is concerned with the business logic and the application data. It
can be used to perform data validations, process data and store it. The data can
come from:
flat file
database
XML document
Other valid data sources.
This is the business layer. It helps retrieve data from the database. These are simple
class files that contain the properties.
DEFINING MVC ARCHITECTURE
6
View – this part deals with presenting the data to the user. This is usually in form
of HTML pages.
It is also responsible to display the data provided by the model in a specific
format. It has a similar usage with the template modules present in some popular
web applications, like wordpress, joomla, Magento, Laravel etc.
DEFINING MVC ARCHITECTURE
7
Controller – this is the part deals with the users’ requests for resources from
the server. As an example,
when the users requests for the URL…/index.php?products=list, the controller
will load the products model to retrieve the products data then output the
results in the list view. In a nutshell, the controller links the models and views
together depending on the requested resources.
The controller is the first thing which takes a request, parses it, initializes and
invoke the model and takes the model response and sends it to the
presentation layer. It’s practically the leant between the Model and the View, a
small framework where Model and View are plugged in. In our native php
implementation the controller is implemented by only one class, named
unexpectedly controller.
DEFINING MVC
8
CONTROLLER
SEND DATA
MODEL
USER
VIEW
MVC FRAMEWORK
MVC AS A FRAMEWORK
9
index.php
Parses the URL
Often mod_rewrite used
Initializes proper controller
Executes correct method
Facilitates communication from controller to view
Signals view to render
MVC AS A FRAMEWORK
10
Directory Structure
Outside of web root. More secure! (generally)
config/
controllers/
models/
views/
Usually not PHP files
includes/
Any extra libraries, e.g. PHPMailer, Mailchimp
framework/
Framework system files (don’t have to reside in application)
WHY USE MVC
11
CakePHP
Mozilla Addons
The Onion’s Online Store
Symfony
TED.com
Yahoo! Bookmarks
Microsoft
Godaddy
DELL
Stackoverflow
Pretty much everyone.
CONCLUSION
14
https://www.w3schools.com
https://www.c-sharpcorner.com
https://www.php-html.net
https://www.dzone.com
https://www.slideshare.net
https://www.wikipedia.org
https://www.google.com
THANK YOU!