Archive, ASP.NET
     

Getting Started With ASP.NET MVC

For seasoned ASP.NET developers, with the advent of true MVC support in ASP.NET, it may a little confusing of how and where to start.

For starters what is MVC, and what does it have to do with ASP.NET?

MVC is a software pattern for the UI tier, most popularly used in website development. MVC is an acronym for Model-View-Control which happens to be the three core concepts of the MVC pattern.

 

Model

In short your Model is your applications domain model, or business objects. These are the things you are working with. For a domain centric application the model portion of MVC is not going to be any different than what you are dealing with today in classic ASP.NET.

View & Control

Perhaps the most confusing aspect of MVC for classic ASP.NET developers is the relationship between the view and control and how that differs from classic ASP.NET’s ASPX markup and code behind model. Conceptually they are similar. Both the view and ASPX markup control how the HTML is rendered, while the controller and code behind control what is rendered.

The difference is in how the view and control interact versus how classic ASP.NET’s code behind interacts with its ASPX markup. In classic ASP.NET the code behind knows about the controls present in the ASPX markup, and the ASPX markup knows about methods (i.e., event handlers) in the code behind. This tight coupling becomes even tighter when pages perform complex databinding events. This two way coupling is preciously why MVC is so popular.

In the diagram above you will see the dependency arrows of the MVC. The control is the coordinator of the whole UI layer in MVC. It knows the model and the view. This decoupling allows for more code reuse and, perhaps most importantly, more robust unit testing of UI logic.

Essential Tools

While MVC is implemented for many different platforms you’re interested in MVC for ASP.NET, so you will need some specific toolkits to get started.

Microsoft ASP.NET 3.5 Extensions Preview – ASP.NET MVC is currently a pre-release technology available in the ASP.NET 3.5 extensions preview.

Since this .NET 3.5 you will need Visual Studio 2008. Express editions of Visual Studio are not officially supported, fortunately in a previous post I discussed used ASP.NET MVC from Visual Studio Web Developer Express 2008.

That should be enough to get you started using ASP.NET MVC. Since MVC design concerns are mostly platform agnostic the Internet contains a wealth of information, albeit most of it does not specifically mention ASP.NET.

Never miss an article! Subscribe to my newsletter and I'll keep you updated with the latest content.

 

About Jason

Jason is an experienced Entrepreneur & Software Developer with a demonstrated history of working in the oil & energy industry. Skilled in Leadership, Mobile Development, Data Synchronization, and SaaS Architecture. Strong engineering professional with a Bachelor of Science (B.S.) in Computer Science from Arkansas State University.
View all posts by Jason →

Leave a Reply

Your email address will not be published. Required fields are marked *