aspose file tools*
The moose likes Struts and the fly likes Difference between DTO,FormBean & ActionForm 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 "Difference between DTO,FormBean & ActionForm" Watch "Difference between DTO,FormBean & ActionForm" New topic
Author

Difference between DTO,FormBean & ActionForm

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi all,

I am going through the book

"Programming Jakarta Struts" by Chuck Cavaness...

I am not able to differentiate between a FormBean , DTO and ActionForm

can anyone throw some light on this?

Regards,
Aneesh
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In Struts, the terms ActionForm and Form bean are pretty much synonymous. They both refer to JavaBean that has the Struts ActionForm as an ancestor. A DTO, however is an JavaBean that follows the Transfer Object Java EE pattern. A DTO's job is to transfer data to and from the Model objects. A DTO might have similar properties to your ActionForm, but it should not Extend the Struts ActionForm. The reasoning behind this is that you want to keep your model objects free of any dependencies on on a View platform such as Struts.


Merrill
Consultant, Sima Solutions
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Thanks Merrill......

 
Don't get me started about those stupid light bulbs.
 
subject: Difference between DTO,FormBean & ActionForm