• 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

mvc, VO, and tier leakage antipattern

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read that you're not to by-pass the view and model tiers without using the controller, however, many examples in books have their jsp use bean:write tags to directly read from a VO. So, what's the scoop? Do I duplicate read only text in the actionform or is the VO considered neutral territory?
Thanks
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to always be aware of the intended audience of the book. Is the sample code supposed to show a best practice or just illustrate how something works? A lot of code examples in "beginner" type books are meant to simply illustrate how something works; you would not actually code it that way in actual practice unless you really want to get fired. A VO (the preferred term now is Transfer Object) is meant to facilitate movement of data across layers so to go directly to a TO in the View is undesirable, IMO.
[ April 08, 2004: Message edited by: Junilu Lacar ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SCWCD Exam Study Kit [Deshmukh/Malavia] has a nice illustration on page 371.
Anyway, the View (JSP) can access the Model and/or the VO for population of values.
In true MVC the Model can also update the View but this isn't possible in web applications because the server can't "push" a new page to the user's browser.
reply
    Bookmark Topic Watch Topic
  • New Topic