Null support in ColdFusion 2018

Null is an important construct in modern programming languages, which improves language interoperability with other tech stack and programming languages. Before the 2018 release of ColdFusion, a database null or a null returned from an external service was getting converted to empty string. Therefore, if you were to code for null or take decisions based on null value in your ColdFusion applications, there was no inherent way to achieve this. Imagine a scenario where you want to have an empty […]

Enhanced Support For New Operator

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.

Default Function In Interface

Default functions can be provided to an interface without affecting implementing components as it includes an implementation. If each added method in an interface is defined with implementation then no implementing component is affected. An implementing component can override the default implementation provided by the interface. Imagine a scenario where you want to add a new function to a public interface, without default function, it would be a Herculean task since all consumers will need to provide an implementation. A default function is the solution, as the default […]

Asynchronous Programming In ColdFusion (2018)

With advances in computing and transition from single-user desktop application to web-based application, multi-threading emerged as a core feature for all modern programming languages. In ColdFusion, you can implement threads using cfthread. However, to simplify the things further, we have introduced Asynchronous programming in the 2018 release of ColdFusion. Benefits Easy to use syntax with object-oriented styles. In-built chaining capability with then() and error() constructs, therefore, it’s easy to model your workflows. Result of an execution as Future, so easy […]