MVC Excitement
Jeffrey Palermo pointed out that MS (ScottGu) maybe coming out with an MVC implementation in ASP.NET. I welcome the idea. At the same time I am very curious how they will solve the routing table that is so handily managed by RoR for example.
In the case of our PathNET implementation , we actually used a couple database tables. I know it seems a little heavy but a table can be cached, and with SQL Notification service refreshed very nicely and specifically. The big advantage of this approach is that you can completely change the work flow of an application at run time. How does it work? Here is a short pseudo summary.
Every request goes through a controller. So you may hit something like (chopped for easy formatting)
http://download.skilljam.com/WebSite/Site/Downloads/
Landing.aspx?moduleId=135&webApplicationId=58
The landing page in this url is merely a very light weight front. Sort of gatekeeper if you will. Actually it should be noted that the Landing.aspx could just as easily be constructed as a .ashx or even better in an ideal scenario you might have something like this – don’t click it, its bogus
http://download.SomeCompanycom/WebSite/Site/Downloads/ListAll
Notice there is no file at all. Anyways we had to work within the specs of dealing with a legacy asp application and several other restrictions which led to the use of an actual page. Imagine if you were to hit the pretend controller – you know the ListAll – here is what happens.
The request is intercepted by the controller. All requests go through the controller by the way. Thats why its a controller. The controller determines what it should do with this call to ListAll. In our case we use IoC to have the controller determine at runtime what assembly to instantiate and hand the execution to. In most cases the controller matches an Action Class in its cached representation and instantiates the Action via IoC. Very cool. The Action executes and depending on success or failure routes the execution to the next step. ( Here is another example of an action framework )
Considering the huge investment MS has in WWF I doubt that ScottGu would be able to make the case for the much simpler usage of config files or data tables to accomplish the work that WWF does in part. (Yes I know it does so much more).
So there you have it. MVC can be done in ASP.NET and we have used it in several production apps. As a matter of fact, I am using it right now to bridge some very old school systems that send profile updates via query string params. I know…. how can they do that right? Well, the exciting aspect of this task is the fact that I am telling the partner company to hit my controller with his query string . There are no UI elements at all. The controller hands the request off to the appropriate Action, which does some decryption work, updates the profile and if necessary even returns an xml representation to the caller. (like I said its old school)
The point is, this entire somewhat convoluted legacy process is made so much easier by MVC and an Action Framework, its amazing.
UPDATE: Just saw this note on K. Scott Allan’s blog . It shows that there is a lot more to WWF than just a finite state machine.
Write a comment