Thursday, December 22. 2005Why MVC works for Web ApplicationsComments
Display comments as
(Linear | Threaded)
When do I get the spiffy uniform and lightsaber?
- Davey
It's interesting that this could even be an issue...
I've used Apache Struts and Hibernate on several projects now and I would never develop a significant application in anything else! It's use of MVC is stunning. For instance, I can at the drop of a hat cluster my database and 2 days later decide to switch database all together and use a text file, it's that easy! But MVC doesn't stop at database abstraction. The controller and view are important separations also. Another example would be; in a system, I'm able to use the exact same controller class(es) to send data to a WML, PDF, HTML, etc version of a news summary page. All I have to do is change the view. Since the controller always outputs the same data, I'm simply able to add a new 'view' to manipulate that data into whatever format I wish.
But here's a teaser - do you require MVC to have your seperations? Is there any other pattern that might fit using the same sort of seperations? There are other similar patterns around, such as model view presenter: http://www.martinfowler.com/eaaDev/ModelViewPresenter.html
I'm not arguing against seperations - just asking if MVC in particular is the right pattern to have adopted got web applications.
Model View Presenter seems to require a presentation layer (i.e. to *display* the data and controls for handling it), this seems to not quite fit when Web Services come in to play.
Admittedly, I didn't do much more than scan the page for a few minutes, so I will review again later when I have more time - Davey
Note also I'm not saying Model View Presenter is appropriate for the web (just a random pattern which serves a similar kind of purpose to MVC) - just there may be alternative patterns to MVC which have a better fit for the web,
The article that got me started "Beyond MVC": http://today.java.net/pub/a/today/2003/12/11/mvc.html - talks about an alternative at the end. Interesting what it seems to be suggesting looks like what people like ActiveGrid are doing (ties into the whole SOA buzz) - something like "workflows and services". I need to time to expand and research further which I don't have but the direction that path seems to be going in is seperate your "forms engine" (which might be server side or client side) from your resources / services. Perhaps what I'm really trying to get to is something about how frameworks need to make a distinction between "resources" in the HTTP / REST sense where "actions" should be restricted to HTTP methods, placing less emphasis on the Controller, and form processing / UI stuff where there might be a large vocabulary of actions (AddToCart, RemoveFromCart etc.). Anyway - enough already. |
About MeConferencesNone at this time! Calendar
QuicksearchTagsArchivesBlog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||


Harry Fuecks' made some interesting observations on the Model-View-Controller (MVC) pattern of application development as it applies to Web applications in a very long post called MVC and web apps: oil and water: What I’m really trying to say here is
Tracked: Dec 22, 13:42