O'Reilly logo

Object-Oriented Programming in ColdFusion by Matt Gifford

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

Implicit accessors

With the evolution of ColdFusion 9 we are able to write the same powerful, functional components, but with less code. In some instances, this may be due to the fact that we no longer need to write our core components in tag format, but also due to the powerful ability to have the accessor/getter and mutator/setter methods generated for you if required.

This is achieved from the accessors attribute within the main component tag. Following is a ColdFusion 9 specific version of our complete Person component:

<cfcomponent displayname="Person" output="false" hint="I am the Person Class." accessors="true">
accessors attributeaccessors attributeabout<cfproperty name="firstName" type="string" default="" setter="false" /> <cfproperty name="lastName" ...

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