- ActionForm mutators will have signatures such as void setProperty(String prop)
- ActionForm accessors for non-string properties will have signatures such as int getProperty()
- validate() will be responsible for doing the checks to ensure that accessors will succeed in converting the String to the necessary type for the property
I see several advantages in this approach. First of all, it allows me to handle invalid types gracefully, by providing the user with an appropriate ActionMessage, rather than just throwing an exception when the conversion is attempted. Second, it provides my Action with an ActionForm that has already "converted" its properties to the appropriate types, and thus the Action is not responsible for doing so.
However, something about the disymmetry (is that a word?) of this arrangement bothers me. Can anyone confirm or deny that this is a good approach, and if not, why?