24
COLD FUSION Deepak Sethi

COLD FUSION

  • Upload
    burton

  • View
    74

  • Download
    3

Embed Size (px)

DESCRIPTION

COLD FUSION. Deepak Sethi. What is it …. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows programmers to develop applications that access databases. - PowerPoint PPT Presentation

Citation preview

Page 1: COLD FUSION

COLD FUSION

Deepak Sethi

Page 2: COLD FUSION

What is it….

Cold fusion is a complete web application server mainly used for developing e-business applications. It allows programmers to develop applications that access databases.

Its also a language to write on an application which run on the server. It provides simple scripting syntax for usage on high end servers. It was produced in 1995 by Macromedia/ Allaire.

Its also a tool for rapid development as it’s a tag based programming language also visual tools make it highly productive.

Page 3: COLD FUSION

When the page is loaded cold fusion tags are executed. If there are any calls to the database , Cold fusion accesses the database and performs the actions (inserting data , updating , retrieving data).

The browser then displays the running HTML code as it does with any other HTML code.

Page 4: COLD FUSION

Performance….

High Performance- integrating with databases, emails, directories, J2EE, .NET, XML, and enterprise systems lets one develop complex Web applications quickly and easily.

Security – Cold Fusion also benefits from the latest internet security tools. It provides web based and network security to provide enterprises with secure systems.

Page 5: COLD FUSION

Performance….

Saves maintenance money: It hides complexity and uses less lines of code (more intuitive) to achieve more results. It allows its users to migrate their material to various web servers & database engines with minimal amount of changes.

Applications can change platforms and Database engines: if an organization decides to upgrade their operating system , they can readily move their cold fusion applications from web servers and operating systems with minimal changes.Database engines can be changed with a little effort.

Page 6: COLD FUSION

Advantages

Cold Fusion has several advantages. A lot of companies are switching to it even when PHP and ASP are available free of cost. There are several features which are included in it :

1. File uploading feature with ease2. Full text search3. Reading and writing mails in a much easier way then

ASP.4. Business graphing

Page 7: COLD FUSION

Other advantages

Integration of HTML and XML , making web based applications more easier and faster to develop.

Enabling encapsulation , hence eliminating excessive scripting and increasing productivity.

Cold Fusion Extensions (CFX) that serve as re-usable components.

Page 8: COLD FUSION

Drawbacks…

-Only runs on windows environment (windows NT)

- Fairly expensive

Page 9: COLD FUSION

Cold Fusion vs. ASP

Database connectivityASP: connectivity through ODBC / ADO objectsCold Fusion: connectivity through CF tags*** Cold fusion tags for connectivity are some what easier then ADO objects

DebuggingASP: Runtime errors sent to browser Cold Fusion: configurable debugging information sent to browser.

*** Cold fusion has a better debugging

Page 10: COLD FUSION

Cold Fusion vs. ASP

SyntaxASP: developer friendly, scripting syntax, Visual Basic friendlyCold Fusion: Tag based , HTML friendly. Supports Java script

scripting.*** Cold fusion tags are relatively simpler

Data ManipulationASP: pretty much directCold Fusion: tags usage makes it implicit *** ASP record set manipulation instead of tags is more flexible

Page 11: COLD FUSION

Cold Fusion vs. ASP

ExtendibilityASP: server components are created using tools like VB ,VC++Cold Fusion: Extension tags can be created by using CF language ,

C++ API. Java class usage can also be added using outside tags.*** CF can use any ASP components plus a user can define his/her tags.

Pre-built functionalityASP: uses VB library functionsCold Fusion: function library and server objects*** both have excellent support

Page 12: COLD FUSION

Cold Fusion vs. ASP

Error HandlingASP: Default screens are ugly . One can trap and handle errors in the

script but the process is ugly.Cold Fusion:Specified default errors in HTML templates, consistent

display , ability to trap errors in script and conditional logics *** Cold Fusion better support for customized messages

Page 13: COLD FUSION

CFML

CFML stands for Cold Fusion Markup language. This programming language is tag based and is mainly used for developing web based applications. Its supported by Cold Fusion and some other third party servers.

It has mainly 100 tags and almost 200 different functions to perform various programming operations. Each CFML tag has an opening and a closing tag just like HTML.

CFML files are given the extension .cfm just like HTML files are given .html extension.

Page 14: COLD FUSION

Getting started…..

One mainly requires two things to work with Cold Fusion:1. Cold fusion server to run ones applications2. An editing environment . Best is Dream weaver MX

but any other text editor could be used as well.

One also needs to have a good knowledge of HTML and SQL for working with Cold Fusion.

Cold Fusion can be directly brought from Macromedia:

www. macromedia.com/buy/

Page 15: COLD FUSION

Getting started….

A trial version can also be downloaded from macromedia’s website:

www.macromedia.com/software/coldfusionThis would run free of charge for 30 days from the day of

installation. All major databases are supported by Cold Fusion :

Microsoft SQL Server, Oracle, DB2, Sybase, and Informix

Page 16: COLD FUSION

Syntax…

Forms<FORM ACTION="template name" METHOD="POST"> Form fields, CFML and HTML tags </FORM>

Required fields<input type=“text” name=“name” size=“10”>

<input type=“hidden” name=“name_Required” value=“Name is required”>

Gives an error message

Page 17: COLD FUSION

Syntax

Queries <CFQUERY>

<CFQUERY name=“userinfo” DATASOURCE=“database name”>Select user_id, user_nameFrom usersWhere user_name=“MSU”</CFQUERY>

<CFOUTPUT><CFOUTPUT>#user_name#</CFOUTPUT>This will display the user name MSU on the page

Page 18: COLD FUSION

Syntax

Displaying values from a query to a select:

<h5>Please select a user</h5>

<select name=“user_id"><cfoutput query =“userinfo"><option value="#userinfo.user_id#"># userinfo.user_name#</option></cfoutput></select>

This will display user name from the query in the single select

Page 19: COLD FUSION

Syntax

UPDATE from form fields

<CFQUERY NAME=“user update“ DATASOURCE=“database name">

UPDATE users (user_name) VALUES ( ‘#Form.name#')

</CFQUERY>

Page 20: COLD FUSION

Syntax

sending e-mails

<CFMAIL>

<cfmail [email protected]=“[email protected]" bcc=“[email protected]"

subject=“announcements">

Page 21: COLD FUSION

Syntax

File Upload<cffile action = "upload"

           fileField = "formfield"           destination = "full_path_name"           nameConflict = "behavior"           accept = "mime_type/file_type"           mode = "permission”>

File actions: rename, copy, delete, move

Page 22: COLD FUSION

Syntax

Cookie

<cfcookie name="cookie_name" value="text" expires="period" path "url">

<cfcookie name = “user" value = "#Form.user_name#" expires = "10">

Page 23: COLD FUSION

Syntax

Conditional logics<cfoutput query = “users">

<cfif user_name is “MSU" OR user_name is “Moorehead"> <H4>user:<cfif user is “MSU">MSU<cfelse>Moorehead

</cfif></H4> <cfelse>”user not found”

</cfif>

</cfoutput>

Page 24: COLD FUSION

QUESTIONS???