One of the language enhancements in ColdFusion 10 beta is implicit/automatic constructors for CFC's. In short this means that if a component has defined properties and there is no init function ColdFusion will look to match the parameters passed in to the properties. Lets take a look at how it works:
component accessors="true" {
property firstname;
property lastname;
}
user = new user( firstname="Homer", lastname="Simpson" );
writeDump( var=user, format="text", showudfs=false );
Which will produce:
[cfc1] component user Properties: firstname: Homer lastname: Simpson
Parameters can be passed in as name-value pairs or as a struct:
By: Michael Zock 05/01/2012 5:12 AM