Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

struts

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

any one please answer this one.

In struts framework, is there any disadvantages using dyna validator form and dyna action forms?

[ June 22, 2007: Message edited by: ambarish reddy ]
[ June 22, 2007: Message edited by: ambarish reddy ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I personally don't like DynaActionForm and seldom use it except for "demo" type applications. The main things I don't like are:

- It's more verbose and more awkward to retrieve the value. You have to write:

instead of


- If you misspell something, the compiler doesn't catch it. In the above example, if I write dynaForm.get("customerNmae") the compiler won't correct me and I won't find out it's wrong until run time. If I write myForm.getCustomerNmae() the compiler will correct me.

- you have more flexibility with a regular ActionForm. If you want to do something fancy in a getter that will manipulate the format of the property, you can.

Furthermore, if you're using a good IDE such as Eclipse or NetBeans, writing an ActionForm is at least as easy as writing the XML to define DynaActionForm properties in the struts-config.xml file. All you have to do is define the properties and invoke the tool to create getters and setters.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ditto what Merrill said. I get annoyed by the "define it in xml and then you don't have to write any code" mentality...you still have to write code but now it is in xml and you get no help from your IDE or compiler.

- Brent
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic