asp.net and mvc
I have recently started to create an application using the new ASP.NET MVC framework. My first impression of the MVC and MVP pattern was that it was too much work for the little result I got back.
After watching the videos that ScottHa has put up, and digging into this application I’m working on, I’ve definitely found a value in the new framework. First and foremost, the basic event lifecycle of an MVC page is gone, as well as ‘runat=server’ tags and server controls that render data for you. Furthermore, viewstate and the regular postback that we have learned to love is gone as we know it.
All we’re left with is asp/php-esque functionality… And that is where the beauty is.
I’ll have to be careful on how I go about presenting MVC from here on out, as I don’t want to argue that php or classic asp is > or < asp.net, but there is something to be said about having full control over your pages, but without mixing up “business logic” with our “presentation layer”.
What MVC (who’s concept is decades old, but we’re just now catching up…) does is allow us to split up our application into 3 functional parts that represent the data, logic and presentation. How is that different than any application built in asp.net today or back in ol’ 99 when we were using classic asp? Well, the framework itself forces us to keep these separate. Sure you can add logic to your pages and data access in your business directly, but if the framework is split out, so that objects that you need already apply the separation of concern, why would you? MVC in ASP.NET allows you to completely control the output of your data. Nothing is rendered for you via server controls. You’ve actually got to WRITE the code yourself to do it.
After reading what I’ve written for this post, I’m not making a great argument for MVC over plain old ASP.NET. What I am making an argument for is getting back to basics and realizing that most of our applications are basic CRUD. Sure, the presentation may be different, or the user experience, or the way we process data, but at the end we’re moving data from store to client and back.
I will probably try to sell MVC later when I get a better grasp, but for now, I’m going to continue writing my application using the December CTP bits of MVC and see how that goes.