Question

Today I was just working on developing a mobile application using ColdFusion 11. I have used cfcs to call some function.

But I am not able to get what is the exact difference between client side and server side cfc?

Anyone used it?

Was it helpful?

Solution

Consider this code:

<cfoutput>
#now()#
</cfoutput>

To run this code on browser, you will give the *ip:port/path_of_file* of the ColdFusion server and you will get the current date-time.

Now wrap this code in <cfclient> tags, make an apk/ipa using CFBuilder and install application on Mobile. Turn off the internet connection in mobile, run this app, everytime you will get the updated date-time.

You noticed what just happened here? You wrote a code in CFML, ran it using server, but to run again and again you do not need a server. You build application using cfclient(client side) and your application will become independent of server. Which means, you can create an application using ColdFusion and distribute on app store without maintaining a server to run it everytime.

Difference: In server side, for every call you need a server running in background. In client side, it's create once and run any number of times without server running. And you know what, behavior will be exact same as you expected in server. You do not have to learn Android/Apple programming or even javascript. Just start creating independent mobile apps with your existing knowledge.

How it works: CFML code is converted into HTML/Javascript, so that code can be run everytime on browser(independent of server), to give you dynamic results. Generated HTML/Javascript gets converted to mobile application using PhoneGap. PhoneGap being in picture, you have the power of using all(which phonegap provides) mobile features with CFML calls like camera, filestorage, geolocation, contacts and many others.

CFC: CFC in client side gets converted to javascript file and gets included in your index.cfm. The function call you wrote in CFML gets converted to a javascript function call which will be called at runtime(when you will run your app in mobile or browser).

In case you are running your app in browser, you will not see much of the difference but if you see the generated source code, you will get an idea that everything gets converted to javascript and browser runs it. IMO the real power is in making mobile apps.

OTHER TIPS

Client side cfc is translated into javascript and runs on the browser. It is a new feature for ColdFusion 11

Server side cfc is more or less translated into Java is runs on the server. In ColdFusion 6 through 10, this was the way that CFML was ran.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top