The Model View Controller pattern (MVC) seems to be the pattern du jour in many development shops. That is until of course, some literate nerd reminds everyone, that there is "No Silver Bullet." The recent rush to Ruby on Rails, which implement this pattern out of the box, has only served to add to the number of people singing the praise of MVC. Microsoft marketing fed programmers seemed to be quick to retort that the WebForm in Asp.NET is in fact an MVC implementation. I can't speak for others, but "the codebehind is the controller" always felt a bit like kissing your sister.
The other day I started playing with MonoRail, Castle's MVC implementation for the .NET framework.
"MonoRail differs from the standard WebForms way of development as it enforces separation of concerns; controllers just handle application flow, models represent the data, and the view is just concerned about presentation logic. Consequently, you write less code and end up with a more maintainable application."
My first reaction after overcoming the newness and understanding the project/solution layout was that this felt like how it should be. I was programming a class and that class held nothing more than data about the object. My controller for that "model" was shuffling things around and making the decision about what to do and when.
There are obviously some things you give up when going to MonoRail but I hope to assuage your fears and mine by digging in a little further. Here are the items I have on my notepad to learn:
The MonoRail/Castle team has done an incredible job in my mind at making this a viable option instead of WebForms. I still have a lot of reservations about the end-to-end usage, but I've let down my guard immensely after getting my feet wet. Judging from the user base out there by viewing blog posts and/or forums about MonoRail there's enough of a following that I'm fairly certain the issues above are solved. If they are in fact solved, then I have great confidence that they'll be just as easy and "right" to use as MonoRail, which will make MonoRail hard to ignore for future projects.
This blog contains the thoughts and discoveries of Tim Barcz, a technologist with a interests in computer programming technologies.