Building with implicit getters and setters


show more Building with implicit getters and setters provides you with in-depth training on Developer. Taught by Daniel Short as part of the ColdFusion 9 New Features show less
please wait ...

Building with implicit getters and setters

One of the pains in building object- oriented ColdFusion and particularly Smart Value objects is dealing with all the getters and setters you need to write in order to protect your properties from malicious data. ColdFusion 8 made this easier by adding the OnMissingMethod() method but that still involved rolling your own solution to deal with building implicit getters and setters. ColdFusion 9 solves this by providing implicit getters and setters on all properties defined by the cfproperty tag, if you want to use it that is.

This offers huge benefits in coding time. So to demonstrate this in the Chapter 4 folder, I have a few files. First I have person.cfc, and gettersandsetters.cfm. Let's take a look at the person's component first. So in here I have defined some cfproperty values. I have Firstname, Lastname, Address, City, State and Postalcode. I have an init() method, which allows me to fill the object with data on the initialization. And then I've hard-coded some getters an...

Building with implicit getters and setters
Video duration: 4m 26s 2h 40m Intermediate

Viewers:

Building with implicit getters and setters provides you with in-depth training on Developer. Taught by Daniel Short as part of the ColdFusion 9 New Features

Subjects:
Developer Web
Software:
ColdFusion
Author:
please wait ...