Matt Williams

Yes, this thread has been most helpful.  Let me see if I understand your 
message correctly and follow up with a few more questions.

So my basic bean for a Trima Machine would have the five properties, TrimaID, 
SerialNumber, Version, InServiceDate, OutServiceDate with matching setter and 
getter methods for each one.  The setter methods would only do basic data type 
validation.  Then there would also be a Validate method that would look at the 
overall data and validate that it is correct, such as OutServiceDate comes 
after InServiceDate.

Then my action page flow would be something like this.  Set each form field to 
appropriate bean property with matching setter method.  If no errors are 
thrown, call Validate method and then either request correction(s) by the user 
or call the DAO to insert/update the database and move on.

My big question is how does this play with object reuse?  Five months form now 
a new developer comes along and creates some new app that for some reason may 
modify Trima data.  They do not realize that they should run the validate 
method, and go straight from setting the properties to running the DAO and thus 
inserting bad data into database.  

Reading the first chapters of a couple of the books suggested in this thread 
has indocterned me in the concept that on object is supposed to be responsible 
for its own action and data.  It seems somewhat counter to this concept to 
expect all future users of the TrimaBean object to call a Validate method 
before running any DAO operations.  Am I over complicating things here?



--------------
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:240795
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