Saturday, March 27, 2010

Create CFCs entirely in - "generate script style code"

Maybe one of the coolest new features in CF9 is the ability to create entire CFC's using a <cfscript> style syntax. And, the CFBuilder will help you build the structure of the code when you check the box labeled "generate script style code."

Learn more from Budd Wright.

Here is an example of the basic structure:

component  displayname="jhjh" hint="Sample Utitility" output="false"
{
 property name="x" type="any";

 public any function getX()
 {
  return x;
 }

 public void function setX( required any x )
 {
  x = arguments.x;
 }

 public  function Hello World()
 {

 }

}

Getting Started with the CF Builder

Here is a quick demo on how to get started with the CF Builder.

Script Functions Implemented as CFCs

One of the big restrictions in using the tag was the inability to use any ColdFusion tags. That meant you could not query the database, send an email or use other powerful tags.

That changes in ColdFusion 9!

ColdFusion 9 allows the following tags to be exposed as CFCs.

ftp (cfftp)
http (cfhttp)
mail (cfmail)
pdf (cfpdf)
query (cfquery)
storedproc (cfstoredproc)

Check out this example in the documentation on how to create a query object by calling the query CFC.

Monday, March 22, 2010

Don't Overlook Regular Expressions

I find in many of my classes that programmers have overlooked the use of Regular Expressions. Sometimes called Pattern Matching, RegEx is used to find particular patterns. It is great to use in form validation but it can also be used for much more.

It is supported in many languages including JavaScript, ColdFusion, Java and many more (including the Find and Replace feature in Dreamweaver!).

Use the RegEx Tester and see some sample Regular Expressions at the Regular Expression Library.

ColdFusion Meetup online

If you have not yet found the online ColdFusion MeetUp, you will love it! They have experts discussing topics from beginner level to very advanced.

Sign up and check out the meeting archive.

Terrific Tutorial on ColdFusion 9

Dan Vega from the Cleveland CFUG has written a great tutorial called Three new user interface controls in ColdFusion 9.

Read it!

ColdFusion Builder released

Adobe's new IDE for ColdFusion has been released. I was at a Cleveland ColdFusion User Group (CFUG) meeting last year where Adobe's Product Manager for ColdFusion showed off many of the features and it looks tremendous. It has had two rounds in beta.

Read more about the new Adobe ColdFusion Builder.

PS - It includes a free copy of the Flash Builder Standard!