On 10/2/07, Ronan Lucio <[EMAIL PROTECTED]> wrote: > > > So I have Business Logic inside DAOs. > Is it a good practice? > If not, how can it be sure any user would be added > without the required fields?
I would say that isn't a good idea. Validation really has nothing to do with data persistence. A DAO is meant to deal with an external persistence mechanism (in this case, a database). That's it (or that's supposed to be it). The database doesn't know or care if the value in the email column is actually a valid email address. That is a business rule, so I'd say it belongs in the business object. Or as Ronan mentions, in a Validtor object that the business object can use to validate itself (separation of concerns = good). Hope that helps. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
