Nicolas De Loof wrote:
As user can edit them, you should set all actionform fields as string.
You can use Collection, arrays and references to obects with String
fields.

This way you can build a "formbean" model that has the same look as
your business object model (or data transfert objects). You can the
use BeanUtil.copyProperties() to populate DTO datas to a formbean and
afert user edited it (and validation occured)transfert formbean datas
to DTO back.

FormBean are this way a "String-copy" of your business, that user can
edit. BeanUtil will convert data types (you can register converters if
needed)

Nico.


Am i right in that BeanUtil can only copy basic data types and not complex data types that i have created myself? Presumably if I have a form that allows changing a user's role ( which is of type Role ) i need to compare the string roleName returned by the form with a cache of possible role objects and if one exists with that name assign it to the user manually.





Do all the fields of an actionform have to be strings? I am confused

as


to when a form field should become an entity in my business logic.

For


example, I have quite complex business objects composed of

ArrayLists,


Dates and other classes. How are these to be set? Do I need to

capture


everything as a primitive type and then have my action build the

complex


business entity? if I am updating an already existing entitiy do I

need


to change every field in it manually?

thanks



--------------------------------------------------------------------

-


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to