Sorry, this is a pretty generic question, but why would we use CF in a Java shop? What does CF offer that we can't already do with Java? I've tried to speak to our Java developers about CF and I get the standard answer "it's a specilized language with no resources".
Any feedback on this would be great.
Thanks!
Hi, Jim,
For me, the top two reasons to give CFML/ColdFusion a close look are (1) Developers have the power of Java at their disposal and (2) It is far and away faster and easier to write web applications with ColdFusion because it's not nearly as complex (in coding, that is).
It gives you the power of Java because, in essence, CF is Java (version 6, aka MX, was a complete rewrite of ColdFusion using Java back around 2001). What this means for Java developers is that ColdFusion gives you access to any Java objects/libraries right from your CFML code. If one has a call for using a Java object in their web application, it takes but one line of code to get going:
<cfset java_object = createObject( "java", "java.lang.some.library.class" ) />
Then you can use that object elsewhere in your CFML code, calling methods, retrieving properties, etc.
In addition to having the Java world at its fingertips, CFML is far less complex to code, thus making it faster and easier than Java alone for developing and maintaining web applications.
Borrowing a commonly referenced example or illustration of CF's ease of use, ask your Java developers if they can connect to a datasource and execute an SQL statement in less code (below) than what CFML needs.
<cfquery name="rs_myresultset" datasource="my_dsn">
select * from my_table
</cfquery>
Naturally, the aforementioned examples of object creation and data access are oversimplified. That said, I do think they serve to illustrate the larger point: CF is just as powerful as Java for web applications but is far easier to write and maintain.
This doesn't mean CF is the right tool all the time but, I believe that given how many programmer hours can be saved using CFML over Java makes it worthy of a close review.
Good luck!
Craig
Thanks for the great answer Craig! I had used CF from 96-99 but not since Adobe bought Macromedia. Since then I've changed companies. My current shop is about 75% Java.
We are investigating Lean so I naturally thought of CF because I know how quickly programs can be written.
I'm going to post another thread on CF and Lean.
Thanks again!!!
In the Perl community, the designer of the original language, Larry Wall, along with the writer of one of the O'Reilly textbooks, came up with what he called "the three virtues of a programmer":
from Wikipedia:...
In many ways, "ColdFusion is like that." It lets you write Java programs ... with all the cool stuff that this entails ... much more easily than you otherwise might, because you are impatient. It works very well at this task because, let's face it, all web-sites (and services) are "99.9% the same." This is a twist on the virtue of laziness because CF is now doing most of the routine, dull, heavy lifting for you. (As for the third virtue, hubris, nothing immediately comes to my mind so I won't force the analogy . . .)
You want to "get a routine thing done," and you have a lot of it to do. So, you express your intentions in the form of CF tags and let the CF engine do its "just in time" magic, and presto... you rode the bus instead of walking. But you were not locked-out in any way from doing "mongo goovy Java voodoo" if you actually needed to do voodoo... which 99.9% of the time you don't.
Based on the declarative-style logic that is represented in the CF code, the CF application-server grinds out a lot of Java for you, and a lot of JavaScript code besides, and it's all "good enuf." Nothing that would qualify as "hubris" but you're not looking for that. You just have several thousand very-boring web pages to get from this side of town, to that side of town, with reasonable dispatch and without dropping any bits. ![]()
North America
Europe, Middle East and Africa
Asia Pacific