portal entry

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

Enhanced Support For New Operator

| View in Portal
July 12, 2018 08:10:08 AM GMT
3 Comments
<p>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.</p>
<p>The post <a rel="nofollow" href="https://coldfusion.adobe.com/2018/07/enhanced-support-for-new-operator/">Enhanced Support For New Operator</a> appeared first on <a rel="nofollow" href="https://coldfusion.adobe.com">ColdFusion</a>.</p>
Labels: Blog, Uncategorized, ColdFusion CFML new operator

Comments:

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
I know this is an old post, but it does appear that new component("path.to.cfc") does call init(). Am I missing something or just reading old information?
Comment by ShawnPO
1696 | February 17, 2019 06:35:46 PM GMT