MVC and ASP.NET forms part II

Well, I was very happy with the adjustment I add to maverick until I check page postback. This check failed due to inner implementation of maverick. So I think my search for MVC framework that support Postback ended without any results. I understand the conflict between classic MVS and postback applications that required preserving data form page call to call. I think that the main reason for that clash is porting of Java MVC framework to .NET, instead of building MVC framework suitable for .NET.

 

In the end of the day MVC is all about separating application logic and data from application presentation layer and that goal can be achieved for postback application as well. MVC also supplies the basic plumbing between application blocks living the programmer to write just application blocks, but implementation of application plumbing doesn't cause any problem.

 

I'll be happy to hear about MVC implementation that decoupled Front controller, Commands, Controllers and pages but if I won't find one I'm very close to write my own. What I have in mind is :

 

a)      Base page that implement setting of command of page request. I can't use the Form action so I thought I can catch Commands by query string or/and hidden Form field. The base page will be responsible for translate command property to hidden field hold page request action.

b)      Instead of IHttphandler request will be catch in Application_beginRequest event. Application_beginRequest will find page command and call command 'Do' method which will run XML definitions set for the given command. Commands can call controllers, specify action by controller return values and/or redirect the request to specify View.

c)      Controller return data will be placed in Context for Page event usage. After Application_beginRequest all command tasks perform, data available in Context for page  and the process chain continue to the request page or redirect to other page (depends on command definitions)

d)      Pages still run server side event but event doesn't call any application block they just access Context to get data they should render to end users.

4 Comments

  • thanks Matt for your comment.



    Yes, I saw it. 1) poor implementation of command, can be improved. 2)using IHttahandler override default behaviour of pages.



    thanks.

  • I look forward to seeing how you go about implementing this. Are you planning a workspace for the development? A good generic framework codebase would be super useful.

  • Regretfully I'm living my work for the next 3 weeks (I'm going to travel USA and to the MVP summit) so I hope my colleagues will finish the work. As soon as we have a working version a NWAF project will be open under SourceForge :-)

  • It looks very interesting, but from what I've looked so far, it's not possible to use the ASPX built-in mechanism for postbacks and page event processing, if the IHttpHandler is not the codebehind the .aspx. I hope you or someone else (or Microsoft) come up with a solution...





Comments have been disabled for this content.