This feature lets you set your CFC property as a simple variable assignment, without specifying the setters. That is, you can set the property by setting the property field rather than by invoking the setter method for the property.
Similarly, the property value can be accessed by referencing the property name, rather than by invoking the getter for the property.

In ColdFusion, you can set invokeImplicitAccessor in a CFC, as well as in Application.cfc.



    name = new empname();
    name.last="Cameron Lynch";
    writeOutput("First: #name.first#<br>");
    writeOutput("Last: #name.last#<br>");


component invokeImplicitAccessor = "true" { 

       property  string first;
       property string last;

    function setFirst(first){
        writeOutput("#getFunctionCalledName()# called<br>");
        variables.first = arguments.first;


    function setLast(last){
        writeOutput("#getFunctionCalledName()# called<br>");
        variables.last = arguments.last;

    function getFirst(){
        writeOutput("#getFunctionCalledName()# called<br>");
        return variables.first;


    function getLast(){
        writeOutput("#getFunctionCalledName()# called<br>");
        return variables.last;

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy