• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AJAX - will it not break the MVC pattern ?

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the point of modeling , putting more and more AJAX code in our JSPs , does it not inherently break our MVC pattern where we are saying that JSPs only acts as a View component .

Suppose we make XMLhttpRequest and receive a response and paint on the screen , then that is OK . But it would not stop with that . Over the days , there would be a single response object that couple of request wants to use and there would be little parsing at clients end to get what we want .This might then grow along with product life cycle.

Authors , Eric and everyone thougts are welcome on this.
[ August 24, 2006: Message edited by: Ram Gokul ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You did not read my book eh.....talked about in Chapter 3! I see how you ranchers are! lol, you should be reading all of the moderators stuff. Ah that is a good laugh...


No it will not break the MVC that people preach about. What is the golden rule? Keep the View and Model from talking with each other?

This is really general here since I do not have much time: Picture a traditional web application. You have a controller that does the "communication" where the datasource can be anything. The view should not care. Well in reality an Ajax front end does not care if the backend is PHP, JAVA, C#, VB.NET, CF, etc. So in reality Ajax is a MVC.

Take a look at this: http://www.theserverside.com/tt/articles/article.tss?l=AjaxinAction_CH4_PT3

Eric
[ August 24, 2006: Message edited by: Eric Pascarello ]
 
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's like asking " A hammer, will it not break the window?"

Tools only do what you do with them.

Sure you could migrate business logic into the pages if you want, but you can do that with any toolset.

Just becasue you now have the ability to make requests back to the server without the need for a full-page refresh doesn't mean you have to break any of the existing common practices with regards to web application structure.
 
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AJAX as a technology doesn't modify the MVC pattern. AJAX only improves the user experience in the interface having now the possibility to overcome the annoying postbacks to the server.

I think that one of the important concepts about AJAX is that it improves the user experience and this is where the extra code goes.The JSPs we still act as the VIEW component in the MVC pattern.


Bogdan
reply
    Bookmark Topic Watch Topic
  • New Topic