Hi Brian,

Aha, now I find the misunderstanding. My save method DOES call the
validation internally independent of the controller call. The only reason
for a separate isValid() method is to allow the controller to elicit that
separately from saving if necessary. I¹m not depending on the controller to
run my isValid() method ­ which I agree would be a bad choice as it¹d allow
malformed data to be saved if you forgot to call the isValid() first. I just
wasn¹t in love with the Success = Order.save() syntax (which I do use
elsewhere) and wanted to try an alternative. Better or worse? Jury¹s still
out for me. I think least bad solution will probably be Order.save() (and
OrderService.save(Order)) just returning either an Error bean with a
collection of errors which I can serialize to XML or an Order bean that
contains any order errors as well as the entered data (which might be easier
to work with from a display perspective).

Best Wishes,
Peter  


On 1/15/08 3:58 PM, "Brian Kotek" <[EMAIL PROTECTED]> wrote:

> Well, it's also ensuring that it isn't the calling code's responsibility to
> run the validation. If my controller doesn't call isValid(), won't that save
> invalid data? It will, unless you force the validation again, internally, in
> the save() method anyway. Which defeats the purpose of having the controller
> call isValid() anyway, doesn't it?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" 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/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to