Wednesday, July 15, 2020

What is the Design Pattern of CakePHP 4?

CakePHP 4.0 follows the MVC (Model-View-Controller) design pattern. MVC consist on three main components. Model, View and Controller

MVC

Model

Any application which is dynamic in nature depend on data, model is the container of data.  For example, Student is a model, it contains its related data like First Name, Last Name, Roll Number and Grade. In programming languages data is encapsulated in the objects of as class. Model has a central role in MVC design pattern, whole application revolves around the model. It is used to temporary store data, validate data, and facilitate to permanently store the data in databases. In CakePHP 4.0 model is fat layer as compare to two other components.

View

View is a perspective of viewing the data graphically, it retrieves the data from model and represents on the page in HTML. For example Student may have different perspectives like its Personal Information, Its Educational Record, or its extra curriculum achievements. Each of these groups of information is handled through models and represented on screen either in tabular format or in any other graphical format like bar charts pie charts etc.

Controller

Controller is the middle layer between model and views, main objective of controller is to receive the request, arrange the data through models and handover to views for display and vice versa. In CakePHP controllers are slim layer.

Today we have seen the design pattern of CakePHP 4.0. It is important to understand the concept of MVC, because whole development of application is dependent of these three types of components. In the next article we will see the whole concept in action through the code.


Related Posts:

  • How to create First CakePHP 4 Application?Welcome, today we are ready to create our first CakePHP 4.0 application. Before we create CakePHP 4.0 project we have to do minor modification in the "Php.ini" file. Start your XAMPP control panel and click on “Config” b… Read More
  • What is the Design Pattern of CakePHP 4?CakePHP 4.0 follows the MVC (Model-View-Controller) design pattern. MVC consist on three main components. Model, View and Controller Model Any application which is dynamic in nature depend on data, model is the container of… Read More
  • How to verify the CakePHP 4 development environment? How to verify the CakePHP 4.0 development environment is it ready to go? Hi guys, those who have not gone through my last posts, where I have explained step by step how to set up the CakePHP development environment, may check… Read More
  • What is CakePHP 4?What is CakePHP? CakePHP is web application development framework based on PHP (Hypertext Processor). It is an open source scripting language and widely supported by the developers communities. It follows the MVC (Model,… Read More
  • What is CakePHP 4 Development Strategy?Hi guys, in the last article we have discussed the design pattern of CakePHP 4.0, today we will discuss the development strategy. When we talk about strategy, first question comes in the mind from where we should start. So th… Read More

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.