struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: Struts Form Beans & Value Objects
Date Mon, 02 Dec 2002 20:32:42 GMT
Most likely, you will find good reasons to have value objects which are
specific to your business logic layer, and value objects which are
specific to your view layer, even if they have identical contents in
many cases.

There's a couple of reasons for this (other people may see others).
Probably the best reason is that your form beans should contain string
values, as that's the form that the user entered the data in, but your
business logic value objects should contain values in your domain types.

You may also find that you have fields in one layer that you don't need
to communicate to the other layer.  It's conceivable you could just
ignore the values that don't apply at one layer, but it would be cleaner
if each layer just gets the data it needs, as if someone else works on
this code, they won't get confused about which values each layer really
needs.

In most cases, you'll still be able to use Beanutils to copy bean values
from one layer to another, even  if there are standard data type
conversions.

> -----Original Message-----
> From: Pat Quinn [mailto:pat_quinn2009@hotmail.com]
> 
> I have an EJB which returns me a HeaderVO (Value Object) 
> inside this VO I 
> have an Array List of LineVO's. As you'd except all my Value 
> objects are 
> Serializable. Ok now i want to display this data to my client 
> so I will have 
> a header html table and a lines html table. My header and 
> lines both contain 
> text fields to allow for client updates.
> 
> Here's where i'm seeking some assistance: should I * Extract 
> the data from 
> my headerVO and insert it into a FormBean and then store my 
> linesVO data as 
> a 2Dimensional Array in my form bean.
> 
> Is there a better way to do this without writing extra code 
> to deal with 
> conversion between VO's and a Form Bean i.e. can i store the 
> value objects 
> instead a form bean but yet allow for user updates to the data.
> 
> Your ideas and suggestions would be gratefully appreciated.
> 
> 
> 
> 
> 
> 
> 
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8. 
> http://join.msn.com/?page=features/junkmail
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message