Thanks but I still does not understand what to do with the attributes
representing a list of other value objects. I will have to write two
converters for each VO in the tree. Is that it or am I missing something?

Stephan

-----Message d'origine-----
De : David Graham [mailto:[EMAIL PROTECTED]]
Envoyé : 14 octobre, 2002 14:32
À : [EMAIL PROTECTED]
Objet : Re: Best practices using value objects

You can use BeanUtils.copyProperties to copy properties between forms and
value beans.  Dynamic forms have nothing to do with this.  Your form could
be dynamic or static.  I would only add properties to the value bean if it
ends up in the database.

Also, it's best practice to not use Vector.  Your variable should be of type
List and implemented with ArrayList instead of Vector.

Dave


>From: [EMAIL PROTECTED]
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Best practices using value objects
>Date: Mon, 14 Oct 2002 11:48:25 -0400
>
>"Best practices using value objects"
>
>I still have questions regarding best practices, the use value object and
>of
>the <beanutil> package. How would you convert a value object to a form bean
>if a property of the VO is a list of other object that would need to be
>converted to a form?
>Here is an example of what I am trying to do. I have value objects coming
>from the business tier.
>
>   VOSchool
>String address
>Vector students
>
>   VOStudent
>String name
>int status
>boolean isPresident
>Vector courses
>
>I have a page with a lists of all students names, a radio button to
>indicate
>if he is the president and a checkbox that changed the status  is selected.
>
>I think I need a StudentForm with all the info from the VO plus a boolean
>isSelected property. My SchoolForm need all info from the VO plus a
>president property.
>
>-      How can I best reuse by VOs?
>-      Should I add a property to the VOs? How?
>-      Are the forms dynamic forms?
>-      Should I copy all attributes form the VO to a form?
>-      Do I need to write a converter for all my VOs, VO to form and form
>to VO?
>
>I think it is a very common problem but I was not able to find a pretty
>solution nor an example on how to do this.
>
>Thanks
>Stephan
>
>
>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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

Reply via email to