
Introduction
MVC is an architectural design pattern which is used to develop the user interfaces which are maintainable, reusable, and testable. It is used for separation of concerns.
MVC stands for Model, View, and Controller. MVC separates the application into three component like Model, View, and Controller. We will learn in detail what Model, View, and Controller is.
What is the design pattern?
A design pattern is a solution to the problems that occur in software development. Design pattern helps us in applications development to resolve problems easily.
Example of design pattern
- MVC
- Proxy
- Singleton
- Iterator
- DAO
What is ASP.NET MVC
ASP.NET MVC is a web framework from Microsoft which is used to develop the web application. ASP.NET MVC use MVC architecture pattern. ASP.NET MVC are introduced in 2009 by Microsoft.
Advantages of using ASP.NET MVC
Separation of code
- This feature is specified for separating presentation logic from the database related logic. Easy to develop and modify using this feature.
- In MVC based applications the development process is split into three modules like Model - View - Controller.
Loosely coupling
- Loosely coupling represents less dependency.
- Views in mvc are less dependent on models.
- We can easily edit, expand and enhance the application.
Parallel Development
- This feature specifies developing models and views in parallel.
- It means multiple programmers work in parallel on views and models.
- This feature makes your application development is faster and easier.
Easy to perform unit testing
- Unit testing is the concept of testing only a certain portion of the application which is modified.
- In MVC based applications, we can easily perform unit testing.
TDD (Test Driven Development)
- In TDD testers will be guided by the development process.
- MVC applications are more comfortable for TDD because they will be easy to modify at any point of time and any module.
- TDD is one of the latest development processes used in real-time projects.
Model
- Model is a normal C# class.
- Model is responsible to handle data and business logic.
- Model represents the shape of the data.
- Model is responsible for handling database related changes.
Sample code of model as follows,



Join the conversation! Your thoughts help the community grow.