tags:

views:

338

answers:

4

I just downloaded ColdFusion Builder (CFB), and now I'm trying to write a simple "Hello World" app. But I need some sort of server first, don't I? Now what exactly am I looking for here? Is "ColdFusion" like a module that would run on top of Apache, or is it a server itself? What's this JRun I see in CFB? Context Root? RDS User Name? I'm trying to Google for tutorials, but all I'm finding are new languages features in CF9 which don't really help me, and stuff that relates to "MX" which is from 2003 I believe.

Databases. Does ColdFusion use it's own database schema, or does it interface with something like MySQL?

What about frameworks? I understand CFML offers HTML-style tags and such, but does it offer any sort of MVC framework for developing websites?

I understand LAMP and Python/Apache/WSGI to some degree, but I'm not quite grasping this CF yet. Can someone point me in the right direction?

+7  A: 

Download ColdFusion and install the "developer version" (free). It can also work with its built-in web server (port 8500 by default). Optionally you can use almost any web server you want, like Apache or IIS.

RDS is...

a security component of ColdFusion Server used by the ColdFusion Administrator and ColdFusion Studio to provide remote HTTP-access to files and databases.

The installation wizard will ask if u want to enable it or not before installation.

You can either install CF on your local machine, or install it on a test/dev server, your choice. :)

Database connection is handled by DSN (datasource name). You can set it up once you have CF installed and log into the admin area. Then you can configurate CF to talk to MS-SQL/mySQL or any other DB supported by JDBC. CF also comes with a built-in DBMS, Apache Derby.

To learn ColdFusion, consider reading the wonderful doc: CF9, CF8 (CF9 is 99.9% backward compatible with earlier versions. However if you're maintaining an existing app, most likely it will be ver 8 or 7. So learn from the appropriate doc).

MVC Frameworks? Here's a list, but for small app, they're not really necessary.

Check out FW/1, ColdBox, or Mach-II. If you like RoR, you'll also like CFWheels. Good luck~

Henry
Oh, it's not a small app. It's a big big app. I guess I should have started with downloading ColdFusion itself, rather than the builder. Silly me :D Making much more sense now, thanks!
Mark
:) good luck fixing your big big app. It might be full of spaghetti code already! If you're going to refactor the app into a MVC app, maybe go for FW/1, it's lean and mean (least learning curve, good doc).
Henry
+1  A: 

Just A question. Is this your first language? I gave up programming in cf when .net came out. Much larger job market for c# compared to cf.

Yes, you will need cf server. Fun language /platform for building web apps!

Andrew Siemer
No. I know PHP, Python, C#, C++, MATLAB, ... This is just one more to add to my skillset :) I always stumble on the easy stuff.
Mark
Yeah, it's a bit of an obscure tech to be putting effort into learning if you don't already know it. You might get a better return on your investement from more popular technologies.
UpTheCreek
+4  A: 

There are a number of MVC coldfusion frameworks out there:

  • CFWheels is a Rails-like framework

  • ColdBox is an advanced OO framework and set of libraries.

Both are actively maintained and coming on strongly.

Vincent Buck
+6  A: 

Coldfusion is a script processing server written in Java. Coldfusion requires a Java Server (like JRun), a web server (like Apache), and prior to Coldfusion 9, a database server if you will be using a database. Thankfully the Development Edition comes with all of that built-in for you.

For production, you'll need a separate web server such as IIS or Apache, as the built in web server is development-only. Most likely you'll need a separate database server such as MySQL or Microsoft SQL too. But unless you have a specific need, you can probably get along with the built in JRun Java server and not worry about that aspect of Coldfusion for now.

If you've done any PHP, Coldfusion will be somewhat similar in the way it is setup on the server and how the code and HTML is integrated together in a script page. (YES, there are differences, but that's a good enough comparison as opposed to the .Net setup)

Coldfusion has it's own built in database or you can choose from a wide variety of other databases. You should setup a connection to the database, called a 'datasource' in the Coldfusion Administrator and then it'll be really, really simple to use after that using the cfquery tag.

If you are new to Coldfusion, I would skip all the third party frameworks until you have a good handle of how Coldfusion and your existing app works first. That all adds unnecessary complexity if you're new and the documentation for the frameworks is a little sparse.

Look over the source code. Ask individual questions on here about what it means.

The fastest way to find the docs for a particular Coldfusion function is to Google:

'Coldfusion 8 cftagname' (e.g. 'Coldfusion 8 cfquery' or 'Coldfusion 8 cfqueryparam')

or

'Coldfusion 8 cffunctionname' (e.g. 'Coldfusion 8 structKeyExists')

Click on the resulting livedocs.adobe.com link. (Google works WAY better than the site's internal search engine and Coldfusion 8 seems to be the best linked to Google)

The cfdump tag is handy for simple debugging.

Finally, here's an example of Hello World:

index.cfm (standard Coldfusion pages use the .cfm extension)

<!--- All coldfusion tags begin with <cf
     ...and Coldfusion comments have three dashes.
     These comments will be removed on the server side
     before being sent to the browser
--->

<!--- Set a greeting variable using standard cfset tag --->
<cfset greeting = "Hello World!!">


<!--- Begin HTML --->
<html>
<head>
</head>
<body>

      <!-- Normal HTML comment -->
      <p>I could just say hello world with HTML</p>

      <!--- In order to output Coldfusion within HTML,
            wrap with the cfoutput tag. Variables in HTML are wrapped with hash marks:
            Example: #varName#
      --->
      <cfoutput>
            <p>More HTML, blah, blah, blah...</p>

            <!--- Outputs: Hello World! --->
            <p>#greeting#</p>

            <!--- Or apply a Coldfusion function to the variable.
                  Wrap the variable name with a function name and
                  then wrap the function with hash marks to tell
                  the Coldfusion server to process the statement
            --->

            <!--- Outputs: HELLO WORLD! --->
            <p>#ucase(greeting)#</p>

      </cfoutput>

     <!--- And another way to view the contents of a variable as a developer --->
     <cfdump var="#greeting#>


<body>
</html>

Hope that helps.

Dan Sorensen
This is an excellent answer! Very detailed, and very helpful! Wish I could upvote you many times!
Mark