The MVC Snake - What do these other stages such as 'ViewFactory' mean?
First check the slide that is referenced here: http://开发者_如何学运维weblogs.asp.net/leftslipper/archive/2007/12/10/asp-net-mvc-design-philosophy.aspx
Since I have been using ASP.NET MVC I have in my mind conceptually been aware of the 'URL Routing', 'Controller', and 'View' stages that are shown here...
But what is meant by all the other stages? Can anyone give a synopsis of them? Especially the ViewFactory, what the heck is that and am I suppose to be using it? Right now my Controller just returns Views...
The View Factory (AKA View Engine) is what actually creates the view classes that process the markup you write. If you want to replace the default MVC Views with something like Spark or NHaml then this is the stage you need to change/intercept.
An HTTP handler lets you intercept messages at the protocol level before the request really hits your "application". For example you might plug in a custom error handler for certain response codes. Or you might plug in a special HTTP handler for media you host like images and movies, to prevent other sites from hot-linking.
The MVC Route Handler itself is an HTTP handler; it "handles" HTTP requests by creating the Controller class.
The last piece is the Route which I think is pretty self-explanatory.
精彩评论