portal entry

select a category, or use search below
(searches all categories and all time range)

Enhanced Support For New Operator

| View in Portal
July 12, 2018 08:10:08 AM GMT
In the 2018 release of ColdFusion, there is a handy way to create objects in ColdFusion. The snippet below illustrates how you can use the new operator to create different type of objects.   //ColdFusion Component obj = new component(“path.to.cfc”) obj.init()   // Java obj = new java(“java.class”) obj.init()   // WebService obj = new webservice(“http://webservice?wsdl”, {“webservice”: “parameters”})   Similarly, you can use the new operator to create com, CORBA, and .NET objects as well.
Labels: Blog, Uncategorized, ColdFusion CFML new operator


Just to be clear, this syntax calls init for you: obj = new path.to.cfc(); but this one doesn't: obj = new component("path.to.cfc"); What happened to the other syntax I saw during the prerelease-- did this go away? new java:java.lang.String();
Comment by Bradley Wood
1162 | July 12, 2018 07:56:19 PM GMT
Hi Adobe, +1 to an answer to Brad's question. What happened to the discussed/preferred syntaxes that no longer work? Thanks!, -Aaron
Comment by Aaron Neff
1225 | August 16, 2018 09:44:36 AM GMT