File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Difference between DTO,FormBean & ActionForm" Watch "Difference between DTO,FormBean & ActionForm" New topic

Difference between DTO,FormBean & ActionForm

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 980
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?

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.

Consultant, Sima Solutions
A Kumar
Ranch Hand

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

I agree. Here's the link:
subject: Difference between DTO,FormBean & ActionForm
It's not a secret anymore!