> Is it good or bad to put bad
> and/or partial data into the bean because some of the form data was 
> good and some was bad?
IMHO, since validation is done by the bean, partial data in one of the 
attributes is not acceptable.

Ok, I might almost have enough of an idea to give a first try at this bean/DAO 
stuff.  

But I have a follow up question concerning validation before I start coding.  
Looking at the person/address example provide in an early post by Matt, I see 
the validation being in the setter methods of the bean.  That was my first 
instinct.  But I am confused by the above statement of "since validation is 
done by the bean, partial data in one of the attributes is not acceptable."  Is 
this not contradictory with the validation of each parameter being done within 
the individual setter methods.

Maybe a simple example can explain my thinking better.

FORM ACTION PAGE
<cftry>
....
        trimaBean.setID(from.trimaID);
        trimaBean.setSerialNumber(form.SerialNumber);
        trimaBean.setInService(form.InService);
        trimaBean.setOutService(form.OutService); 
        //This call throws an exception, because the Out Service date is before 
the in service data as an example.

....
</cftry>

First of all, would this not leave the bean in an incomplete state, it would 
have the ID, SerialNumber and InService properties set, but not the OutService 
date.  Is this not a bad thing?

Now I would also want to go back to the form to allow the user to correct the 
data, repopulating the form with the submitted data so that only the incorrect 
datum needs to be fixed.  Where do I get the data to repopulate the form, from 
the bean, which means I would have to store the bad date in the bean to get it 
back out, or some kind of branching logic in the form display to say sometimes 
populate the form from a bean, other times from some other data structure?

This is the kind of thinking that gets me lost.

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

---------
| 1 |   |
---------  Binary Soduko
|   |   |
---------
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:240771
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to