A ColdFusion Component Version of the Shopping Cart

Later in this book, you will learn about ColdFusion Components (see Chapter 26 in Vol. 2, Application Development). Components provide a powerful way to abstract and encapsulate logic. We are going to introduce you to a ColdFusion Component a bit before Chapter 26. If at any point you get confused, don’t worry. A full and complete discussion of CFCs will come later.

At a basic level, a component is a collection of functions (things to do) and data. A shopping cart, which we have already seen brought to life by <cf_ShoppingCart>, is such a collection. Think of the cart as a type of object. The object can execute different actions, like Add, Update, and List. We can think of these actions as ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started 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.