• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Value objects and ActionForms

 
Suri Babs
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • 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.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • 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 ]
 
Junilu Lacar
Bartender
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic