Posted in ColdFusion | Posted on 05-02-2008 | 4,280 views
During the keynote at cfObjective, Jason Delmore had a slide up for maybe 30 seconds or so. He hinted that something special was up there, although it was disguised to most as pseudo-code for fun. Looking at the code, and taking Jason's hints - it leads you to think that you may be able to fully develop CFCs with cfscript. I.e., a 100% script based CFC. Possible CF9 feature?


http://rickosborne.org/blog/index.php/2007/05/09/c...
It's about time.
-R
Full cfscript support would be great. The only reason I don't use it much anymore is that it can't do everything yet, and there is no speed benefit unlike CF5. Otherwise I would be using it 100% outside of views.
CFC's should support a script format perhaps CFS extension, and everything in there is script.
They would also need to add script support to some of the main tags, like <CFQUERY etc.
<cfscript language="ActionScript" strict="true">
private var name:String = 'Dale';
private var employee:Query = new Query();
employee.statement = 'select * from employee where name = %1';
employee.setParam(name, 'String');
employee.execute();
for (var i:int = 0; i++; i < employee.result.recordCount) {
writeOutput('Hello ' + employee.result[i].fullName);
}
</cfscript>
I give a talk on using ColdFusion and Flex together, now its a very easy to do this, recently I had a Flex guy there who was using PHP backend. He was saying, wow how easy is that, I should be doing my backend in ColdFusion. So this is good, getting new people into ColdFuion.
What would make this the first and obvious choice for these types of people is if ColdFusion supported ActionScript. Great I only need to know one language and i'm away.
Hmmm, I wonder could ColdFusion be rebranded in the future ActionScript Server :)
@Dale... I think there is still a good place for tags. Uniquely the concept that CFCs are not a place where you should require tags is a good thing IMO. Tags are great for view based logic.
Coldfusion is a scriptin language compiled to java, and in my expereince it would be far easier to adopt the JSP scripting language or Java style rather than a hashed version of something that adds more complexity.
In Dales example I would prefer to see this instead
<cfscript>
private String name = 'Dale';
private Query employee = new Query();
//Although from Dales example this would be a struct not a query object
employee.statement = 'select * from employee where name = %1';
employee.setParam(name, 'String');
employee.execute();
for (var i:int = 0; i++; i < employee.result.recordCount) {
writeOutput('Hello ' + employee.result[i].fullName);
}
</cfscript>
I am fully against Actionscript in Coldfusion, I believe it is better to adopt a more logical method that is more common in JSP, Java and .Net than go with something that was pulledout of hat just to be different.
And besides, going more like Java means no preprocessing and less translation.
does charlie have this listed on his resource list? i took a look, but i didn't see it.
Second on the list would be a consensus that it should be as easy to communicate with Flex from CF as it is to communicate with a database. Just adding ActionScript will not solve that issue. That will have to be added if they use ActionScript or if they complete CFScript.
? Have I missed any major points here?
Here are some things CF 9 needs badly:
- CFIIS - Finally give us some site creation automation control. This should have been in 6 and every year never seems to make it.
-Expand CFExchange giving access to setup and manage accounts not just use them. Another automation tool CF lacks. I wonder how many developers building big systems out there want to have to manually key in every request to make a mailbox.
-CFDeploy, another huge automation feature that doesn't exist. This takes a zip file deploys it to a specified location AND can automaticly can set application variables to make the site useful in an automated envirnoment.
-Force Flash to add the Flash Remoting libary back into Flash so developer can use CF web services in their apps again. It assumes quite a bit to think everyone uses Flex or is willing to use AS2 and take a huge performance hit to use Flash Remoting. This is one of the worst release decsions I've seen ever.
With out these features any upgrades for CF are worthless to me
- CF8 Enterprise Developer
2) CFDeploy: Could be interesting. Ant does most of this for you. I see this more a tool for Ant than CF.
3) You've lost me. CF ships with Flash Remoting. It is NOT specific to Flex. It works just fine in Flash. Actually, I remember doing the testing for that in the last CFWACK so I _know_ it should work. Unless I'm misreading you?
I really feel like CF is losing touch with its developers needs.
@SameGuy: You've lost me. You want the mail tag params to be dynamic based on a query or a loop? Maybe you can show a simple example? Also, have you reported these issues? If you don't report a bug, Adobe can't fix it. http://www.adobe.com/go/wish
2. Yeah there are tools out there, but like CFImage, its time to get with the times. Some things just make sense to have in there.
3. I've been searching since AS3 release for Flash Remoting solutions for Flash CS3/4. After so much searching and I've had encounters with many other developers with the same gripes that claim the reason it doesn't work is the libaries don't exist and thats why the same classes that work in Flex don't work in Flash. I have CF8 WACK all 3 books, and it covers it in the Flex sense, it does not crack an .fla and show you how in AS3. All the demos seem to be like this everywhere, and it has a lot of devlopers frustrated. There are a couple that haven't, but they also don't work.
Outside of the automation tools and the Flash issue, which I think is Flash after talking with the dev team at MAX, CF has been great for me until I got into complete automated site deployment and management.
I dropped my real e-mail this time. Let me know if you know of anything that can help me out in that department.
3) Maybe I don't quite get your issue here then. I remember working on a chapter for the WACK that did a quick FR test using a simple FLA to show movie titles. It has been a while, but I seem to remember. Flash Remoting, as far as I know, has NEVER been Flex only. FR _predates_ Flex, so I'm not sure how it could be.
FYI, in CFWACK back in CFMX days we did indeed have a chapter on using Flash Remoting and ActionScript to connect to ColdFusion from Flash. That was before Flex days. Since Flex was released most ColdFusion coverage has moved from CF/Flash to CF/Flex because, well, Flex is typically more appealing to coders like CFers. The same CFC calls via Flash Remoting can be invoked from Flex or Flash, at the end of the day it's the same Flash Player. But, yes, there is going to be far less content out there on using Flash versus Flex.
--- Ben
2. didn't get a response on this one :) so it made the cut?! Between 1 and 2, that means our new app as complex as it is, it can be completely built and automated from CF and that makes me happy and says a lot about the platform.
3. Yeah, from my experience even though they should be interchangable, they aren't. At first I thought maybe I was crazy and just wasn't finding it, but then as time went on I found a lot of people with the same issues and at MAX I asked a lot of questions and Adobe developers wouldn't confirm or deny, all I got was "NetConnection has to be reworked in a future version of Flash."
PS - Yeah I was a closed Beta tester for CF8 and x64 and I didn't want to get my app shot down for Centaur cause they know I'm bringing all the automation complaints.
We have to use AS3 (AVM2) in all our apps. They usually involve video and are way too CPU intensive to downgrade to AS3
--- Ben
Thanks for all the interaction by the way.
<!--- loop through IIS servers --->
<cfloop list="#IIS_Server_List#" index="IIS_Server_Name">
<!--- CreateIIS --->
<cfif form.CreateIIS>
<strong>Creating IIS Website on [<cfoutput>#IIS_Server_Name#] - #form.domain#</cfoutput></strong><cfflush>
<cfquery name="qry_UpdateTask" datasource="Tasks">
UPDATE tbl_Tasks
SET task_status='Creating IIS Website on [#IIS_Server_Name#] #form.domain#'
WHERE ID='#url.taskID#'
</cfquery>
<cfquery name="qry_InsertTaskHistory" datasource="Tasks">
INSERT
INTO tbl_TaskHistory(TaskHistory_taskID,TaskHistory_Status,TaskHistory_CreateDate,TaskHistory_BenchMark)
VALUES('#url.taskID#','Creating IIS Website on [#IIS_Server_Name#] #form.domain#',GetDate(),DateDiff(ss,#benchmark5#,#benchmark6#))
</cfquery>
<cfset benchmark7 = Now()>
<CFEXECUTE
NAME="c:\WINDOWS\System32\cscript.exe"
ARGUMENTS="c:\mkw3site.vbs -c #IIS_Server_Name# -v -r #form.drpath# -t #form.domain# -o 80 -h #form.domain#,www.#form.domain#"
timeout="500"
>
</CFEXECUTE>...done!<br>
<!--- <cffile action="READ" file="e:\a\admin\#form.domain#.txt" variable="outfile"> --->
</cfif>
<!--- /CreateIIS --->
</cfloop>
<!--- Add virtual directory to IIS --->
<cfif form.CreateIIS>
<strong>Creating IIS Virtual Directory<cfoutput> [ #form.domain# CFIDE C:\Inetpub\wwwroot\CFIDE ]</cfoutput></strong><cfflush>
<CFEXECUTE
NAME="c:\WINDOWS\System32\cscript.exe"
ARGUMENTS="c:\WINDOWS\System32\iisvdir.vbs /create #cgi.server_name# CFIDE C:\Inetpub\wwwroot\CFIDE"
timeout="500"
outputfile="e:\a\admin\#form.domain#_vdir.txt">
</CFEXECUTE>...done!<br>
<cffile action="READ" file="e:\a\admin\#form.domain#_vdir.txt" variable="outfile">
<cfoutput><pre>#outfile#</pre></cfoutput>
</cfif>
<!--- /Add virtual directory to IIS --->
[Add Comment] [Subscribe to Comments]