February 2016 ~ MiTechDev.com

Monday, 29 February 2016

Introduction to ASP.NET MVC

04:16:00 Posted by raviteja swayampu No comments

Introduction to ASP.NET MVC

Now a days every organization,schools and business need of online reputation to show themselves to the outer world through internet.And electronics devices are became part of our life(Mobiles,Desktop PC,Tablets,smart phones etc).We are using internet every day.Internet nothing but websites that contains large amounts of data.So ,developers have to develop web applications or web sites based on the demand using different technologies like,

  • ASP.NET Webforms
  • ASP.NET MVC
  • Java
  • PHP
  • Python
  • perl
  • Ruby on rails
etc....

The above specified are the mostly used web technologies for web development..We can choose the technology based on the application requirement like it is a personal blog or small site PHP is better option and if you want to develop a larger applications that have to maintain millions of users then go for either java or ASP.NET MVC(mostly in software industry java is the prefered technology larger application because of Db integration.Microsoft Db tool won't handle much user).

Here, our topic is about ASP.NET MVC so i am coming to the point.

MVC is a new technology developed by microsoft to enhance some features of asp.net application.Therefore,in an application,we may need to create multiple view for a single model.When developing a small application,there is no need to separate data access ,business logic,presentation logic and control codes in an application.But when developing large enterprise level application,interweaving  makes code files more complex,therefore it will be difficult to manage while implementing changes in future. As a result the  implementation ,testing and maintenance efforts are also  duplicated.To reduce this problem,we have to separate the application like
  • Presentation logic
  • Business logic
  • Control logic
 The solution to these problems comes in the form of a Model -View-Controller(MVC) Design Pattern.which separate the data access ,business logic and presentation logic and enables creation of a number of views accessing the same enterprise application model.
This is also technically called as "Seperation of concern"(Soc).Soc is the best feature of ASP.NET MVC.The dependency on Presentation logic and Database logic are completely reduced..we can make changes to the application regularly it wont effect Db logic(this is the big problem faced by many developers in the traditional web development)..

If you want to develop enterprise level application then you have to use two  microsoft .net technology.
  1. Model -View-Controller(MVC) 

Model View Controller

You already Know, A web application requires interaction with different types of clients with different types of user interfaces. If a web applications require interaction with multiple types of clients,so different  types of applications are required to support each type of client.This creates lots of problem in designing ,debugging and maintenance.The solution of this problem is the use of MVC architecture while designing an application.
There are three types of interfaces can be used to access the information from the internet as given below

1.) HTML View :- Many web users want to view web application in HTML format (static page). MVC framework provide this feature to our web users.
2.) WML View :- Nowadays, most of the user accessing information through mobile ,laptop,tablet etc.on wireless network.MVC framework provide this compatibility to our wireless users.
3.) Form View :- This features can be used only by Administrator .MVC Framework is also helpful for this purpose.


There are three main component of MVC as give n below:-

  • Model
  • View
  • Controller

Model:

Model contains database logic during request fro0m client it communicate with the controller and db to give the response for client.these logic will communicate with Db.

Controller:

Controllers are nothing but Classes in MVC those are responsible for the request receiving and processing and displaying Views.It will communicate with both Models and View.It gets data from models and sends to view to display.

View:

Views are UI elements.It gets data from controller and display as a plane html.
There are two view engines in ASP.NET MVC there are,
ASPx engine
Razor View engine
we will talk about this view engines later in next tutorial..