- Loose Coupling
- Lightweight code
- Effective look
- Testing is Very Easy
- Rapid application integrated development.
MVC Architecture
The architecture of MVC can be seen in the following figure:
Figure: MVC Architecture
Explanation
User will make request for the page which user would like to retrieve. Requested page will go to controller and on controller Route.Config will be checked. Requested page will get transfer to Model from Controller.
On Model there will be 2 steps,
- View Engine get the request from Controller
- The requested page will get executed
- The result got by the execution process will get deliver to View.
Life Cycle of MVC
Life Cycle of MVC as in the following figure:
Figure: Life Cycle of MVC
Explanation of MVC Life Cycle
Step 1: User will make request for page
Step 2: Route.Config will get check on Controller
Step 3: After Route.Config validation request will get transfer from Controller to Model
Step 4: Page request will go to Model & on Model the following operation will perform.
a. Page initialization will start and after initialization of page
b. One result set will get generated
Step 5: Generated result set will get deliver to Controller from Model,
a. On Model Page validation operation will perform.
Step 6: After page validation on controller, Page will deliver to View through View engine.
Step 7: Now user can see requested page as response page.
Life Cycle of MVC can be seen as in the following figure:
Figure: Life Cycle of MVC
Explanation: