Hi Ronan,

Couple of comments. Firstly, I do want to suggest strongly that  
putting this in the bean is better than the service class as otherwise  
you can end up with "procedural code using cfc's" which I see a lot of  
still. Secondly, I'd strongly suggest using setter injection in  
ColdSpring/Lightwire or your own custom factory to inject an object  
with the methods yu need rather than calling an application scoped  
util library. Otherwise stubbing/mocking it out for testing is going  
to be more of a problem.

Best WIshes,
Peter

On Jul 2, 2008, at 4:40 PM, Ronan Lucio wrote:

>
> Peter Bell escreveu:
>> I'd have some kind of validate method on the bean. Probably use it to
>> call a composed validation bean. I'd put the logic there.
>
> Good suggestion, the validation could be in the set() methods
>
> <cffunction name="setComment">
>    <cfarguments name="comment" type="string" required="true" />
>
>    <cfset variables.comment = application.libUtil.ConvertToHTML(
> arguments.comment );
>
> </cffunction>
>
>
> <cffunction name="setURL">
>    <cfarguments name="stringURL" type="string" required="true" />
>
>    <cfif Left(arguments.stringURL, 4) neq "http">
>       <cfset variables.stringURL = "http://"; & arguments.stringURL />
>    <cfelse>
>       <cfset variables.stringURL = arguments.stringURL />
>    </cfif>
>
> </cffunction>
>
> Thanks,
> Ronan
>
> >


--~--~---------~--~----~------------~-------~--~----~
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