Here's yet another question.

This is similar to the one brought up in late January, "Re: [Xdoclet-user]
Need help with Value Objects and Struts Form Beans"

The problem expressed there, and the one I have, is that:

-- you can get a Data or a Value object from your base class. (getXXX).

-- From the Data object, you can set the fields from another Data object,
and you can get() a Value object.

-- From the Value object, you can set the fields from another Value object.

-- A Form can be created (new Form()) from a Data object.  You can set form
fields from a Data object. And, you can get a Data object from the form.

Because a ValueObject is bound to have more information than a data object
(ie, related objects), it makes more sense to carry the Value object within
a user session.  When prepopulating a form, it's impossible (without going
into the generated code and adding your own routines, that is) to set the
form fields from a VO, and there's no way to get a Data object from a VO.
This requires hand-coding lots of  DO.setXXX(vo.getXXX()) calls -- the same
boilerplate code already pasted out in the Base object, et al.

Is there a design reason why Forms cannot be populated from a Value object?
Or why Data objects can't be retrieved from a Value Object? (the latter
makes more sense with the understanding that data objects are being phased
out).   Konstantin suggested using reflection or Jakarta's Sandbox.  I think
that's overkill when it's just more boilerplate code that's already being
pushed out in other objects.

Any light would be appreciated!

thanks

--adam


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to