• 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

Value objects and ActionForms

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between value objects and ActionForms?
And can i use the Values from Value objects and set them to ActionsForms instead of request Attribute.
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Suri Babs:
What is the difference between value objects and ActionForms?


Value Objects are generic objects which contain strictly data, often used to communicate the state of a business object, whereas ActionForms are specialized classes which reflect the state of a view and contain methods for resetting and validating view data.

And can i use the Values from Value objects and set them to ActionsForms instead of request Attribute.


It is common practice to copy values from a Value Object to an ActionForm, and vice versa. An easy way to do this is by using the Commons BeanUtils package. This article discusses the BeanUtils package if you need more info, although doesn't explicitly use Struts for its examples.
[junilu fixed link]
[ August 22, 2003: Message edited by: Junilu Lacar ]
 
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 should also note that the preferred name for the pattern is now Data Transfer Object, not Value Object. This tutorial makes extensive use of the pattern.
[ August 22, 2003: Message edited by: Junilu Lacar ]
 
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic