You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vladimir Levin <ap...@hotmail.com> on 2002/03/30 16:33:32 UTC

Re: Re[4]: Does this tag exist & architecture [was] This hopefully is a simple question that has been dealt with

I would say this is reasonable. I get the impression this is the
general approach currently being taken by most Struts developers. There
are two drawbacks I can think of to consider before coming to a final
decision:

  1) Unless the code is being generated, there is more manual
     labour involved in coding the two bean classes and the
     code that maps them one to the other (and this has
     to be updated when changes to the bean are made). [You can use
     the Struts BeanUtils class (see BeanUtils.populate and
     BeanUtils.describe methods in the api:
     http://jakarta.apache.org/struts/doc-1.0.2/api/index.html)
     as a basis for a way to automatically
     map one type of bean to another type of bean.]

  2) Performance penalty for copying a list of result beans to
     a list of form beans.

>     1) get Collection of EmployeeBeans from DB
>     2) *Extra step now will be a method that now returns a Collection
>     that converts the above Collecion into EmployeeForm beans
>     collection.
>     3) Now use the EmployeeForm bean collection for display.
>
>     Then possibly same thing for inputing..
>     1) user inputs form
>     2) form bean passed to a method which would covert it to
>     EmployeeBean (obviously having first been validated)
>     3) Now EmployeeBean is used to populate DB.
>




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[6]: Does this tag exist & architecture [was] This hopefully is a simple question that has been dealt with

Posted by Rick Reumann <ma...@reumann.net>.
On Saturday, March 30, 2002, 10:33:32 AM, Vladimir Levin wrote:


VL>   2) Performance penalty for copying a list of result beans to
VL>      a list of form beans.

         Exactly. What if you a very large result set of Employee
         objects being returned. Now you have to go through this
         entire Collection again just to populate another very similar
         collection that has different data types for the members. I
         guess I just need to decide if this tradeoff is worth it.





--

Rick

mailto:maillist@reumann.net

"If I was the head of a country that lost a war, and I had to sign a
peace treaty, just as I was signing, I'd glance over the treaty and
then suddenly act surprised. 'Wait a minute! I thought we won!'"
  -Jack Handey


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>