O'Reilly logo

ColdFusion 8 Developer Tutorial by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Our First Object

Our first object is a generic model of a product. There are things that different products have in common. This object will be a reflection of the common attributes and methods that we will use to model a product (object). Our product (object) has attributes and methods. Let us work through this whole chapter again before you form an opinion of CFCs in code:

Product (object)

  • Attributes
    • name
    • description
    • price
  • Methods
    • set_name
    • get_name
    • set_description
    • get_description
    • set_price
    • get_price

As we work through these examples, we will also continue to refine this in order to make it even better. The following is an example given in code:

<cfcomponent> <cffunction name="init"> <cfscript> variables.attributes = structNew(); variables.attributes.name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required