What is MVC?


The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components:
Model
View
Controller

Each Layer work his own Specific Task for to make a Web application.

 MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.

MVC Components
Model: 
Model we can say that it’s a one type of Business logic of your application.
The Model component corresponds to all the data related logic that the user works with. This can represent either the data that is being transferred between the View and Controller components or any other business logic related data.
 For example:
When user can submit his request to make a loan to count so that loan count business logic we have to develop here on this file (e.x java file ). And send the respondse the view back or controller.

Another Example:
A Customer object will retrieve the customer information from the database, manipulate it and update it data back to the database or use it to render data.

View:
The view we can say that is simple presentation layer in which we make our view part it’s called GUI for user.
The View component is used for all the UI logic of the application. For example, the Customer view would include all the UI components such as text boxes, drop downs, etc. that the final user interacts with.
For example:
Registration, Login Page in which the user can see that at their browser which is dynamic and effective lookout of web application page. In which we can make using HTML, CSS, JS, and JavaScript.

Controller:
Controller is done set and get the property of the incoming request from the view and model.
Controller is use to call the particular action for the incoming request form the view by user
.
Which action is called for a particular request is decide by the deployment descriptor (Struts.xml)
Controllers act as an interface between Model and View components to process all the business logic and incoming requests, manipulate data using the Model component and interact with the Views to render the final output. For example, the Customer controller would handle all the interactions and inputs from the Customer View and update the database using the Customer Model. The same controller would be used to view the Customer data.
For example:
If user submit a request to calculate the interest than the which action file have to call for the particular request its decide by the Struts.xml for that request.












Previous                                                                                                                                                                                           Next

0 comments:

Post a Comment