At the Spry session at CFUNITED I talked about some code I used for my various Spry demos. This code converted queries to XML objects to use for Spry. (By the way, I'm working on some code that may make it even easier to use CFCs - no more converting to XML!) I just cleaned up my demo code a bit and cleaned it up in a nice CFC. The CFC has a listToXML, arrayToXML, queryToXML, and structToXML.
Any comments are welcome.
Comment 1 written by Emmet on 2 July 2006, at 3:42 PM
Comment 2 written by Raymond Camden on 2 July 2006, at 4:26 PM
Comment 3 written by Kyle Hayes on 2 July 2006, at 4:29 PM
Comment 4 written by Lola Lee Beno on 2 July 2006, at 4:51 PM
Comment 5 written by emmet on 2 July 2006, at 5:04 PM
Comment 6 written by Simon Horwith on 2 July 2006, at 5:23 PM
Comment 7 written by Raymond Camden on 2 July 2006, at 6:14 PM
Comment 8 written by Dan Sorensen on 2 July 2006, at 7:07 PM
Thanks for the CFC example, makes working with SPRY a little more interesting. :-)
Comment 9 written by Simon Horwith on 2 July 2006, at 7:35 PM
Comment 10 written by Raymond Camden on 2 July 2006, at 8:05 PM
Comment 11 written by Simon Horwith on 2 July 2006, at 8:17 PM
Comment 12 written by Raymond Camden on 2 July 2006, at 8:23 PM
Although - I compared the XML generated by my code using my simple query and converting the same thing to wddx. My XML was 415 characters. The WDDX was 611.
Comment 13 written by Michael White on 2 July 2006, at 8:31 PM
Comment 14 written by Simon Horwith on 2 July 2006, at 8:34 PM
Comment 15 written by Raymond Camden on 2 July 2006, at 8:43 PM
Comment 16 written by David A. on 3 July 2006, at 12:06 AM
Comment 17 written by Teddy R Payne on 3 July 2006, at 9:30 AM
As for the XML functions and component ideas, I can see an immediate use for the functions in the realm of configuration files. If you wanted to create dynamic xml config files, then easy to use functions would be a good way to speed that up in conjunction with the other XML functions provided with CF.
Serialized data will always be a problem for transferring data. Flex really makes this beautiful. The flash remoting will slowly become my tranfer layer du jour. You have to love raw data.
Data sushi style!!
Comment 18 written by Neil Bailey on 3 July 2006, at 8:44 PM
Loved your CFC talk (even though it turned out you are right about passing in a structure instead of individual arguments :) at CFUnited. Also, thought that your Application.CFC article in the new CF mag (can't remember the name off the top of my head) was excellent as well.
That being said......
In MY humble opinion, SPRY isn't ready for prime time. Its a nice little toy, but not overly sophisticated in what it can/will do, and its ability to allow the developer to modify the user experience is sorely lacking (other than its HTML table capabilities). I think you are pretty much dead-on-balls-accurate with pretty much every single thing out of your mouth, and I can't understand how you can be missing the mark THIS much with SPRY - I feel your so far out there on this one that is makes me feel that maybe I am wrong, simply because I agree with you so often (does that make sense??)
I understand you're not an Adobe employee - or even associate, if I understand correctly - and its not your job to sell their products. But, if you could, explain why I should use SPRY instead of AJAXcfc, for example.
Please don't misunderstand me - I am truly not attempting to rain on your SPRY parade here; I am just a touch nervous with my OWN outlook because in this instance it is completely different from your own. If you have a second, explain how SPRY competes with the 800lb gorilla in the room - in this case (again, IMHO) AJAXcfc.
I appreciate it. Your blog is an excellent resource, even if it is offbase on this one :)
nb
Comment 19 written by Raymond Camden on 3 July 2006, at 8:55 PM
First off - in the future - please know it is ok to disagree with me. No need to worry about offending me. ;)
Spry is NOT released code yet. I would only use it on a production site if you were sure it would work well for you. But there is a reason Adobe calls it a Pre-release, because that is exactly what it is.
Spry right now is super good at reading AJAX data. By that I mean, it is trivial to use Spry to bind data to a remote data source. I have yet to see a system do that as easily.
It isn't just tables, but tables are used in most of the examples. I know I showed sme drop downs as well.
There -are- widgets in Spry, but they haven't been heavily documented yet. Future releses will show more information about them.
Does this make sense?
Comment 20 written by Raymond Camden on 3 July 2006, at 8:55 PM
Comment 21 written by Neil Bailey on 3 July 2006, at 8:59 PM
I am very new to the entire AJAX scene (we've been using it for the the last couple of weeks), but it just seems to me that with such an established, easy to use, flexible AJAX framework as AJAXcfc is already in the marketplace, it would behoove Adobe to work w/ Rob to make AJAXcfc perfect (hell, call it SPRY, call it whatever you want) - just that starting OVER seems.....silly.
But, who am I to second guess the ways and days of Adobe? I personally think that they are also WAY off the mark with Flex2, but again, what do I know.....
Comment 22 written by Raymond Camden on 3 July 2006, at 9:26 PM
Flex 2: Why do you not feel it rocks? I mean, I can't think of another way of making RIAs.
Comment 23 written by Neil Bailey on 3 July 2006, at 10:17 PM
Yes you can build a really cool storefront in Flex - but you wouldn't....again, the load time would come into play and your customers would be gone. You could build all kinds of really cool things in Flex - but, the bottom line is, other than geeks like myself seeing what I can do simply to see if I can do it, I truly don't see Flex (or the other products like it - read Lazslo) making much of an impact - the overhead is truly just too great. Its like this really cool concept car that everyone flocks to a car show to see, but would NEVER buy for their daily commute to work.
What else would you use to build an RIA? Well, its funny you ask that, because after we rewrote almost all of our apps in Flash Forms (curteousy of the lobbying of yours truly - MAJOR mistake), we asked ourself the exact same question. What we came up w/ is straight DHTML using an AJAX connector (AJAXcfc in our case) to connect to the backend.
If I seem to be pushing AJAXcfc hard, I don't mean to - I swear I have no connection w/ Rob Ghonda at ALL (never met him before last Wednesday). AJAXcfc just really, REALLY saved my bacon by providing a reasonable alternative to the Flash Forms. Does AJAX provide the same built in validation that the Flash Forms do? No, of course not. But the apps now load in 3-5 seconds, instead of the 45-50 seconds they were taking to load before, and to my boss, that is more important than built-in validation - which we can write routines to replicate anyway.
Sorry for the extra-long response.
nb
Comment 24 written by Simon Horwith on 3 July 2006, at 10:26 PM
Comment 25 written by Neil Bailey on 3 July 2006, at 10:36 PM
I have, however, built a large number of flash forms, which use remoting to connect to a CFC on the back end (ala ASFusion). And as I said in my last post, this is my only frame of reference for a real-world app (I understand that they are two different things, but I believe that Flash Forms are a sub-set of Flex, no??) And I can't see a single thing we would EVER use Flash Forms for again. They look slick, and the validation is fantastic, etc etc etc.
But I can get the same (well, a comparable, anyway) slick set of UI widgets from DOJO, and can duplicate the remoting functionality w/ AJAX. And the form loads in single digit seconds - usually under 5. When Flex can deliver an app in under 5 seconds, then maybe it has real world usage.
All of that being said, not a single person has been able to tell me what they would build in Flex for a real-world, paying project (hell, I asked Ben himself personally that exact same question at CFUnited, and he - perhaps unintentionally - completely sidestepped the question). A dashboard. Ok, I will give you that.
A storefront? Maybe, I guess..... what else? Tell me this: would you build an online employment application in Flex? How about a credit card application, or a patients' notes app for a physician or a part ordering system or a........THESE are the applications that are built in ColdFusion (at least in my experience, and I have been doing this for a fairly long time). Flex isn't ideal for ANY of them - you could force it I suppose (we DID, with the Flash Forms), but why force a square peg into a round hole WHEN YOU HAVE A ROUND PEG!!!!????
I don't mean to rain on the Flex2 parade - rather, I am looking to be convined!
Comment 26 written by Raymond Camden on 4 July 2006, at 7:22 AM
Use of Flex: Ignore Flex for a minute and focus on RIA. If you need convincing that RIA's themselves make sense, I'm not sure what to say. Maybe I'm brainwashed but I thought it was obvious. Of course you wouldn't replace every web page with a RIA, but somethings really do make more sense as a RIA. Control panels, for example, make more sense as a RIA.
I think we will definitely see folks misuse Flex, just as we saw folks make bad use of Flash, and CF, and .Net, etc. Any new tool will have sites that misuse the technology.
As for speed in general, again, I know I've seen Flex2 apps load very quickly. They will never be as fast as plain jane HTML, but I think the trade offs are more than worthwhile, and save you time in the long run.
Comment 27 written by Neil Bailey on 4 July 2006, at 11:44 AM
Of COURSE I see the value in RIAs - the value is immeasurable in terms of web applications.
My question is this: why not write RIA applications with a DHTML front end, a CFC handling the database (and whatever else needs handling) and an AJAX connector between the two?
This will give you - in my mind, at least - almost the exact same capabilities (minus that slick Flash look of course), but with a load time that is about 40 seconds faster.
My main question is not what you wouldn't use Flex for, but specifically what you WOULD use it for? I can think of a dozen RIAs off the top of my head without even really trying, but not a single one of them is a good fit for a Flex application - again, this is all my opinion. I am actually sincerely seeking to be convinced otherwise!
Comment 28 written by Raymond Camden on 5 July 2006, at 8:34 AM
Comment 29 written by Neil Bailey on 5 July 2006, at 9:52 AM
I still haven't been able to get a single real-world example - other than a dashboard - that is a perfect fit for Flex.
Comment 30 written by Raymond Camden on 5 July 2006, at 10:01 AM
Comment 31 written by Neil Bailey on 5 July 2006, at 10:13 AM
Unfortunately, my only frame of reference for real-world applications is Flash Forms. And Ray, they truly killed us - to the point that people almost lost their jobs@
If real-world, functionality-heavy Flex2 apps are truly loading in 10 seconds, then I would agree that Flex2 is the RIA platform of TODAY, let alone tomorrow. I just haven't seen it.
As for HTML load time: we have converted most (not all, yet) of our Flash Forms to HTML/AJAX, and the avg load time is about 5 seconds. If equivalent Flex apps were to load in...hell, 15 seconds, I would be happy (we're talking 6 grids, 5 tabs - each with..maybe 20 fields each; the grids need to be displayed dynamically, depending on the selected criteria, as do certain of the tabs).
Also, I haven't YET heard of a single real-world application - again, I agree with the dashboard concept, regardless of the loadtime; so other than a dashbaord - that YOU feel Flex2 is IDEAL for.
Thanks for listening to (reading??) my rambling.
Comment 32 written by Kyle Hayes on 5 July 2006, at 1:32 PM
Comment 33 written by Neil Bailey on 5 July 2006, at 1:41 PM
Sure, I could write a Word Processor, but I have MS Office. Sure I could write a... hell, I dunno, anything, but the point is: WHY!
My main point is this: I think flex2 will be a cool little toy. Again, it will be like the concept cars that the car companies put out: they generate a lot of discussion, and the whole world thinks that they're cool, but NOBODY DRIVES THEM TO WORK!!!
I want my apps to look as slick and as cool as the next guy, but.... I, personally, just don't see much of a marketplace for this. After the initial "cool" factor dies down, I think this will be the next Spectra.
And still, nobody has been able to tell me what they would use flex2 to build. Its like the emperor's new clothes - everyone says Flex2 is the future of the internet because everyone ELSE is saying that flex2 is the future of the internet.
Or, maybe I am just missing the point...if so, tell me what you would build in flex2. Not a general category of applications like "desktop apps for the browser", but specifically, what? A dashboard. Ok. What else?
Comment 34 written by tony weeg on 5 July 2006, at 5:10 PM
tony was a dumb ass for not seeing it... right :)
ok, you can apologize at ANY time ray!
later holmes.
Comment 35 written by Gary on 14 July 2006, at 4:33 PM
Comment 36 written by Raymond Camden on 15 July 2006, at 4:21 PM
Comment 37 written by Paul Baylis on 26 April 2008, at 7:43 AM
Comment 38 written by Paul Baylis on 26 April 2008, at 7:45 AM
Comment 39 written by Raymond Camden on 26 April 2008, at 9:48 AM
Comment 40 written by Paul Baylis on 27 April 2008, at 3:16 AM
<cfinvoke component="data" method="getData" returnVariable="data">
and using it in Spry, e.g. as follows:
<script type="text/javascript">
var mydata = new Spry.Data.XMLDataSet("data.cfc?method=getdataXML","/people/person");
mydata.setColumnType("age","numeric");
</script>
Just thought it might have been included with the download files. As a newby, I was just wanting to see how it all fits together.
Comment 41 written by Raymond Camden on 27 April 2008, at 7:50 AM
Comment 42 written by Mamtha on 16 October 2008, at 12:48 PM
Comment 43 written by Raymond Camden on 16 October 2008, at 3:24 PM
Comment 44 written by Paul Klinkenberg on 25 February 2009, at 11:38 AM
You can read about it and download it here: http://www.leeftpaulnog.nl/2009/02/toxml-function-...
Hope it's of use to someone; it helped me anywayz ;-)
Comment 45 written by Roger on 20 July 2009, at 4:52 AM
Comment 46 written by Raymond Camden on 20 July 2009, at 5:27 AM
[Add Comment] [Subscribe to Comments]