aspose file tools*
The moose likes Struts and the fly likes Value objects and ActionForms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Value objects and ActionForms" Watch "Value objects and ActionForms" New topic
Author

Value objects and ActionForms

Suri Babs
Ranch Hand

Joined: Mar 27, 2003
Posts: 50
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

Joined: Nov 09, 2000
Posts: 6450
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

Joined: Feb 26, 2001
Posts: 4706
    
    7

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 ]

Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Value objects and ActionForms