On Nov 9, 2007 9:23 PM, Alan Livie <[EMAIL PROTECTED]> wrote: > > I was doing some validation inside a CFC 'bean' and wanted to validate > the email address. > > I didn't want the email validation inside the bean itself as I know > I'll be needing email validation in other beans very soon. > > I was going to put the email validation method in a generic > 'validation utilities' cfc and compose it into my beans that needed > it. > > I then remembered something from the Kent Beck book on Test Driven > Development where he mentioned he made a class called 'Money' that > acted almost like a custom data type with basic behaviour. He said > small objects were not only acceptable, they were desirable (or > something along those lines). > > Bearing this in mind I think maybe a simple bean called Email that can > be injected into other beans that need it and only methods it would > have was a getter, a setter and validate() > > I'd be interested what others think about this. Is it a good way to go > or is it overkill? >
I think it's a good practice. I also think the reason we didn't see more of this from our OO experts in the past is because the computational cost of using CFCs was high enough that we might fear having too many small types like this. With improved performance, I would expect we'll see more of it, though it may take a while to break the chains of habit. Sam --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
