ColdFusion: Understanding application servers | lynda.com
Articles,  Blog

ColdFusion: Understanding application servers | lynda.com


If this is your first experience building
dynamic web applications with ColdFusion or any other application server,
it’s useful to understand the basic nature of the web and how it works. What we call the World Wide Web is really
a whole bunch of computers that are connected to each other over the Internet
that communicate with each other over a protocol called HTTP. HTTP stands for Hyper Text Transfer Protocol,
and it’s a simple text-based language that lets computers or browsers make
requests and allow servers to send back responses. In the HTTP architecture, a request is formulated
by a client. A client can be a web browser, a cell phone,
or any other device that can participate in web communications. The request is sent in HTTP format for a web
resource, such as a webpage built with HTML, or Hypertext Markup Language, or
image or other binary files, or JavaScript, or Cascading Style Sheet files. The server interprets that request, locates
a resource or generates some content, and returns a response to the client. Each of the clients has a browser of some
sort. The browsers we’re almost familiar with are
those on personal computers such as Internet Explorer, Firefox, Safari, or Google
Chrome, a newer entry. But cell phones such as the iPhone, or BlackBerrys,
or other modern cell phones typically have browsers as well. There are many other devices that can participate
in the web. The server runs some software called an HTTP
Server. The most commonly used HTTP servers are those
listed here: Internet Information Services or IIS, which
is a Microsoft product that’s included with Windows-based operating systems,
or Apache, which is available on pretty much all operating systems, and is
built and delivered as a free open-source product by the Apache Foundation,
a nonprofit organization. Simple HTTP client-server communications work
like this. The web client sends a request for a page,
an image, or some other content. The server receives and interprets that request
and sends the response back to the client. It’s up to the client to read that response,
whether it’s HTML or some other content, and render it, or interpret it, in
some fashion. When you add an application server into the
mix, the application server is connected to the web server or HTTP server. The HTTP request still goes from the web client
to the HTTP server, but then the HTTP server is configured to dispatch that
request to a particular application server, typically by recognizing a file extension
on the request, .cfm for ColdFusion, .aspx for ASP. NET, .php for PHP, or others. The application server then has access to
server-side resources such as a database. It does its work, talks to the database if
necessary, and generates a response which it returns to the HTTP server. Then the HTTP server, once again, sends back
the response to the client. The web client doesn’t know anything about
the application server. All it knows
is that it requested HTML and it got back HTML. The application server is completely confined
to the server environment. There are many available application servers
on the market. In this video series, I’ll be teaching you
how to use Adobe’s ColdFusion 9. Other developers and organizations might use
Microsoft’s Classic Application Server, Active Server Pages, or its more modern
version, ASP.NET. There is also PHP, a free open-source server,
and Java-based servers, sometimes known as J2EE, or Java Enterprise Edition
servers. These services include IBM WebSphere, WebLogic,
and JBoss. Adobe ColdFusion is a special product because
it lets you build these web applications very quickly. It incorporates an enormous amount of pre-built
functionality, covering a lot of the tasks that dynamic application developers
have to do all of the time. ColdFusion is a Java-based web application,
but you don’t have to actually write Java code to build your applications. Instead, you’ll be using a special language
on the server called ColdFusion Markup Language. Your ColdFusion pages will be built in multiple
languages: HTML, Cascading Style Sheets, or CSS, and
JavaScript for the Browser, and ColdFusion Markup Language, or CFML, on the
server. Each ColdFusion page is created with an extension
of .cfm, and when it’s requested from the browser, it’s compiled
in server memory as a Java class. The class is then executed on request and
the ColdFusion code that’s in the page is executed on the server, including any requests
for database access, reading and writing of XML files, or any other server-side
resources. HTML is then generated and returned to the
browser for rendering. Your ColdFusion pages will be a combination
of all of these languages. The more you know about HTML, Cascading Style
Sheets, and JavaScript, the more effective a ColdFusion developer you’ll be. There are two syntax styles that are used
in ColdFusion: the traditional ColdFusion Markup Language,
a tag-based language that looks a lot like HTML, and CFScript, a scripting
syntax that’s more similar to JavaScript or Java. Here are two examples of ColdFusion Markup
Language or CFScript doing the same function. If you want to output a variable to a webpage,
you can either use traditional CFML. You’d wrap a variable inside pound signs to
indicate that it’s a variable, and then wrap that inside a pair of CFOutput tags,
and that tells the server to output the value of the variable to the page. In ColdFusion 9, many of the commands that
we traditionally execute in tag-based language can now also be processed with scripting
syntax. At the bottom of the screen, I’ve shown the
scripting equivalent of the CFOutput tags, a function called writeOutput. Your CFScript code is wrapped inside a pair
of CFScript tags, and then you follow scripting syntax as much as you can. Many developers feel that the scripting syntax
is easier to both write and read than the traditional tag-based syntax. Not all ColdFusion tags have been rewritten
as scripting commands, but in ColdFusion 9, many more are available in scripting
than ever before. ColdFusion 9 includes many new features that
you’ll find valuable. One of the most valuable, and one that I cover
extensively in this video series, is Object Relational Mapping or ORM, an extraordinarily
simple way of communicating with the database. There are also many new tools for integration
with Microsoft Office and SharePoint, including the ability to read
and write Microsoft Word, Excel, and PowerPoint files. There are new integration tools for Adobe
Flex & AIR developers, enhancements to the language, performance enhancements and
many other new features to make ColdFusion 9 easier and more powerful than
before. If you’re new to ColdFusion, you’ll find that
this video series will get you up and started very quickly building ColdFusion
applications. If you’re an experienced ColdFusion developer,
you’ll find some information on the new features here and a lot more in another
lynda.com video series, ColdFusion 9 New Features.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *