On Dec 21, 2011, at 2:07 PM, "Fabrizio Giudici" <[email protected]> 
wrote:

> On Wed, 21 Dec 2011 16:09:21 +0100, Steven Huwig <[email protected]> wrote:
> 
>> My opinion is that the term "MVC" is often misapplied to simple separation 
>> of presentation from program logic. Moreover, it's an architecture that 
>> doesn't actually need to be reflected in the code structure of typical web 
>> applications. In a web application, the browser is the view, the web server 
>> is the controller, and whatever backend code there is is the model. There's 
>> often no need to try to subdivide the backend code into MVC again, because 
>> the backend code should be leaving presentation up to the browser.
> 
> I think I didn't get the point. Can you elaborate?
> 

Well, I'll try to explain by example. MVC literature talks about which objects 
should communicate with which other objects. For example, updates to the model 
should be transmitted to any observing views  -- but in "web MVC" there's no 
conventional means to implement that. Web servers do not push out data to 
clients as a general rule.

Moreover, in server-side code, executions typically last only as long as a page 
load takes, so there's rarely any use in setting up observers for changes to 
the model.

A good half of the power and relevance of MVC is tied up in the fact that it's 
for interactive UIs in object-oriented systems. Applying it to distributed web 
servers and an infrastructure that wants to be stateless doesn't seem to help 
very much.

>> Sure, it's good to keep formatting separate from database updates, but 
>> that's not the same as trying to shoehorn the whole system into one pattern 
>> from Smalltalk that's been extended past its original scope.
> 
> I think it's clear that with MVC we're not referring to the way it was done 
> with Smalltalk. MVC is a pattern for a better separation of concerns and the 
> recurring problems still exists.
> 

That's just a recipe for confusion then, especially since the original sense of 
MVC is still alive in iOS and various JavaScript frameworks. A Spring MVC 
controller is nothing like an iOS UIViewController, so why try to shoehorn them 
into the same "pattern?" That kind of imprecision only serves to make the term 
less useful. If we want to say "separate presentation from logic" then we 
should just say that.

Thanks,
Steve

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to