Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any difference between these ColdFusion components?

Tags:

coldfusion

cfc

I know the result is the same but is there any real difference? Maybe speed or something?

component {

 remote function getMath(){ 

    math = 2 + 2;   

    return math;
  }

}

or

<cfcomponent>

  <cfscript>

    remote function getMath(){  

        math = 2 + 2;   

        return math;
    }

  </cfscript>   

</cfcomponent>

or

<cfcomponent>

  <cffunction name="getMath" access="remote">

      <cfscript>

            math = 2 + 2;   

            return math;

      </cfscript>   

  </cffunction>             

</cfcomponent>
like image 676
Sequenzia Avatar asked Dec 27 '22 08:12

Sequenzia


1 Answers

Not especially.

Version 3, full tags, will be backwards compatible with ColdFusion 8 and the open source versions of ColdFusion server eg. Railo or OpenBD.

Version 2 is neither something or nothing.

Version 1 is the full ColdFusion 9 script version.

I would recommend that you choose between the first and last versions and stick to it. Version 2 is not backwards compatible to coldfusion 8 and is neither tag nor script. Coding like this will get messy quickly.

like image 87
Stephen Moretti Avatar answered Jan 13 '23 18:01

Stephen Moretti