Basic Concepts

Before we continue, I’d like to throw out a few terms from the object-oriented world that you’ll see used throughout the chapter. If you are coming from an object-oriented background, you may notice that some of these concepts are implemented differently in ColdFusion than they are in other object-oriented languages, such as Java. Conversely, if you are new to object-oriented programming, you should be aware that some of the terms here have slightly different meanings or implementations outside of ColdFusion MX:

Object

The foundation of object-oriented programming is the object. An object is an abstraction that is essentially a function containing variables and methods. Objects usually model actual entities in the real world. Using our employee directory as an example, you can model an individual employee as an object. In ColdFusion MX, we generally refer to objects as component (CFC) instances.

Class

A class is a template that is used to create a new object (the new object is called an instance). That is, a class defines the variables and methods for all objects of a certain type. In ColdFusion MX, classes are implemented as CFCs. Individual objects are defined as instances of a particular CFC (class). For example, you may have a CFC called employee that contains variables (instance variables) and methods common to all employees. With an employee class, it’s easy to create individual employee objects.

Component

In ColdFusion, we refer to CFCs as components. In other ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.