Why I Love ColdFusion, part 94

Why I Love ColdFusion, part 94. The more I work with ColdFusion, the more I like it. I've been posting recently about consuming complex web services with ColdFusion and, despite some of the difficulties, I still think it's easier with CF than with, say, Java or C#. I base that claim on the fact that my CF program to manipulate the salesforce.com Web Services is an order of magnitude shorter than the example Java they supply – a tenfold decrease in the amount of code I need to write translates into a huge productivity boost! I haven't checked the C# code but I expect it to be comparable to the Java code. Today I had another delightful experience with the simple power of ColdFusion. For reasons I won't go into, a legacy system here generates emails formatted much like a Windows INI file so that another legacy system can import that data. We want to get that data into a different system. Fortunately, CF can (a) read email easily from a POP server and (b) process INI files with a single function call. The entire CF program consists of a cfpop tag to consume the emails, a cfloop tag to process the emails – by writing each email body to a temporary file (a function call – getTempFile() – and a tag – cffile), reading the data from the file with getProfileString() and inserting that data into our new system (effectively just a cfinvoke) and then deleting the temporary file (cffile again) and deleting the processed email (cfpop) again. A couple of dozen lines, most of which are calling getProfileString(). Wow! Try doing that in ____ (insert your language of choice here)…. [An Architect's View]

Leave a comment