the singularity of being and nothingness
Quickly Falling in Love with Flex
The last several weeks, readers will note that the majority of my posts have been devoted to AJAX, particluarly Adobe's Spry Framework. My main infatuation is that AJAX allows for clunky page-reload based web activity to be replaced with instant, on-the-fly interaction, not only with constituent portions of the website, but more importantly, with server-side processes (especially databases).
All this time, I have flirted around with Adobe's Flex 2, an incredibly rich platform for developing ActionScript 3.0 applications. While I have played around with it from time to time (basically, when I get a new computre–the trial period is only 30 days), I have not really gotten into significant development…until now.
One of the issues with Flex is that, like javascript, it has not native way to interact with a database. For this, one needs an application server of some kind, or to create myriad XML files to store data. Now I've always known that Flex could integrate nicely with ColdFusion, allowing the developer to access independant ColdFusion components to leverage processing logic and database interaction. However, I did not know how ridiculously simple it was.
So one might wonder what the big deal is. So Flex can easily connect to ColdFusion–so what? Well, a major issue is Flex Builder's built-in components. Using Builder, I can create, for example, a slick form–including rich text editor–to create a blog post–all in about, oh, 90 seconds. In HTML, that would take me a while, especially trying to get the CSS to behave on the form fields (urghh…). So now, instead of tearing out my hair trying to build and style a form, I'm already done and I can concentrate on creating validation rules.
But what is especially great about Flex and ColdFusion together is that accessing the component's methods is hauntingly similar to how one would do it in ColdFusion natively.
Consider the following example:
id="addBlogPost"
destination="ColdFusion"
source="Flex_Blog.com.posts" result="success()" fault="failed()" >
<mx:method name="createPost">
<mx:arguments>
<postTitle>{postTitleInput.text}</postTitle>
<postDate>{postDateInput.selectedDate}</postDate>
<postContent>{postContentInput.text}</postContent>
<postKeywords>{postKeywordsInput.text}</postKeywords>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
The way I see it, the "RemoteObject" that I create is alot like my "cfinvoke" tag in ColdFusion–I point to a partcular component (here "source"), define the method (here "createPost") and finally pass in any arguments that I need to (here the "arguments" Array). The best part about this, however, is that in all of this, I have not had to use a postback; I've not had to reload the page; and if I wanted (and probably will do) I could fade out this form to reveal some other bit of content in its place. All seamless, all clean and user-friendly.
Now, if only I could find the $500.00 bucks I need to license it…hint, hint…
Print article | This entry was posted by existdissolve on November 6, 2007 at 12:25 pm, and is filed under Flex. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about -1917 years ago
love means flashing the bling.