Hi Mark and thanks for Transfer!

The main reason for the cfc approach is its easily unit tested. I can crate a 
new factory and pass it a different string for the ajax framework and test what 
I expect to get from the returns is correct.

I do use custom tags heavily (especially in one project where there is no app 
framework involved and custom tags are used as views, called from cfm 
controllers via <cfmodule>) but for things where I can see a reason for a unit 
test I'll choose a cfc.

I'm an addict of the mxUnit eclipse plugin as a 'Test First' tool and a cfc is 
my first choice as I can make sure my object behaves properly before I start 
messing around in the browser. Only when I think something other than a cfc is 
better I'll change my decision.


Alan
________________________________________
From: [email protected] [EMAIL PROTECTED] On Behalf Of Mark Mandel [EMAIL 
PROTECTED]
Sent: 07 September 2008 23:02
To: [email protected]
Subject: [CFCDEV] Re: Encapsulating an AJAX library / framework

Why the choice to use CFC's to output the views, and no custom tags?

Not saying one is better than the other, but curious as to why you
decided to go down that path.

Mark

On Sun, Sep 7, 2008 at 10:39 PM, Alan Livie
<[EMAIL PROTECTED]> wrote:
>
> I have been given the task on a project of implementing some AJAX in the 
> admin area in such a way that if the framework changes its as simple as 
> possible to change to the new framework.
>
> I have decided on jQuery and so far its working well :-)
>
> To try and minimise change to the views I created a cfc called AjaxWrapper 
> that has various methods to create html (the <script> tags with js libraries 
> etc) for the <head> of pages as well as return js strings that can be used on 
> href or onClick events in the View pages. The controller gives all the 
> returned strings from the AjaxWrapper to the Views that need it. AjaxWrapper 
> is given the current framework name in its init() method by the main factory.
>
> I'm going to pick another framework and see how successful my 'Encapsulate 
> what varies' work has been but wondered if anyone has done something like 
> this before and how they designed it.
>
> My other option I considered was to create wrapper functions in javascript 
> that used the selected framework so if the framework changed I should only 
> need minimal changes to have everything running.
>
> It's early days and I may well have chosen a dodgy design but it has been an 
> interesting exercise so far.
>
>
> Thanks
>
> Alan
>
> >
>



--
E: [EMAIL PROTECTED]
W: www.compoundtheory.com



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