Elliott,

To be clear, I only said that clone() should be used when editing an
object.  Consider this scenario...

Step 1: User submits form with data to edit/update an object

Step 2: Grab object from Transfer and populate with new data

Step 3: Validation of new data fails

Step 4: Skip the save, send user back to form with validation error messages

Because we did not use clone() in Step 2 above, you now have bad data in
your Transfer cache.

I would be more than happy to read about how others handle this issue, but
from where I am sitting, the only choices I see to deal with this scenario
are:

1) Use clone() before populating the object with new data

2) Create a completely different object and validate against it (and then
use it to populate the TO if valid)

3) Perform all validation without relying on a business object at all

#1 and #2 seem to be essentially the same to me, so I go with #1.  Otherwise
we get into a 2-for-1 object map scenario.

#3 was always a complete PITA for me prior to being introduced to any OO
concepts.  Having an intelligent object that knows how to validate itself
has been a godsend for me.  So #3 does not really grab my attention much.

Do you have other suggestions?  I am **very** interested in learning how
this is handled by people who have _much_ more experience than I do.  :-)

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to