Another approach to this is to have the form beans
simply hold references to the value objects (from the
DAO) directly.  You can use the nested taglibraries
that are now a part of struts 1.1 to access these when
building html forms.  The slick thing is that when the
servlet populates the form before calling execute(),
it will actually populate the value objects in the
form themselves.  It works by default for most data
types, including Dates.  But you can customize the
converters used for just about any data type.

Stu

Original message:

I am pre-populating a form with information from a
data base.

Is the following procedure acceptable, or is there
another procedure
that would be considered a "Best Practice"?

Instantiate the form bean in the action class.

Instantiate one or more DAO objects in the action
class.

Call methods in the DAO objects that would take the
form bean as an
argument and fill up the necessary fields.

I understand the need to keep layers separate;
however, if I am just
trying to fill up the fields in a form, it seems
unnecessary to have
the DAO objects return data objects and then call a
series of
"get/set" methods to take the data from the data
objects and put it
in the form bean.

Thanks.


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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

Reply via email to