• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

push and pull mvc real time example needed

 
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I am a beginner to struts 2 . Have read few basic concepts. But the push and pull mvc patterns are still not clear after referring so many forums .

My understanding :
In push mvc the data is created and pushed by the server (like setting the values in the scoped variables ) and the view layer is taking that data from the scoped variable .

My doubt :
1.Here view layer is anyway have to pull data from the scoped variables right ? Then why that name push mvc ? Is it just relates to what server is doing and not about the view layer ?

Pull mvc :

the data is constructed by controller and stored in a common place like a value stack and then JSP pulls the data from the common place . (here the name relates to view layer )

My doubt :

2.what is the need for pull mvc ? What is the problem with push mvc (like setting data in scoped attributes )? If this doubt requires any core concept that i need to understand please specify that too . It would be too helpfull .

3.Can anybody give a real time example of these 2 patterns?
 
Ranch Hand
Posts: 417
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Well, struts 1 is a push mvc while struts 2 is a pull mvc. I have been using both extensively and I didn't even know about that ;-)

So, I suggest that you do not worry about it too much. You can always google for it as I am doing right now to learn more about the difference which sounds kind of negligible.

Push:
Controller puts data in scoped variables such as request or session.

Pull:
Controller puts data in the value stack and struts2 tags retrieve it from there.
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Additionally, be careful out there, a lot of people out there seem to confuse the mvc push and pull paradigm with the more well known client/server push and pull paradigm where the server basically connects or maintain an open connection to the client to push data to the client. With regards to that, all common mvc, push and pull, are pull with regards to the client/server push/pull paradigm.
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic