I’ve never heard about JSON until some weeks ago when I was reading an article on web services and data exchange that mentioned JSON. Actually it is a pretty cool mechanism to serialize complex data structures for data exchange or storage purposes.
I hear you saying…”Well, we have that in ColdFusion already, it’s called WDDX”. Right – good point. Let’s have a closer look:
– WDDX is built into ColdFusion by the CFWDDX tag but parsers are available for other technologies as well.
– WDDX is an XML language – so a cool standard somehow…
I can’t even say why, but I never really liked working with WDDX. It always seemed to be some sort of sluggish, slow stuff that I tried to avoid. And I’m pretty much aware of the fact that ColdFusion since MX 6, doesn’t have any performance issues with WDDX – no there should be any reason not to use it 🙂
The big advantage of JSON over WDDX should be that the format is way more lightweighted that XML or particularly WDDX. By the way: JSON is available for a huge range of languages as well.
In one very small project I was doing last month, I decided to give JSON a try and it really integrated smoothly without flaws. I used JSON to serialze a rather large nested struct of data and store it in a database. Same with deserializing – easy and smooth, no issues.
Just today we decided to use JSON to store data in another project with even more complex structures and I still like it.
In terms of performance: I was using the functions provided by the CFJSON project, and they performed awesome. If – for any reason they don’t work for you, you might want to give JSON for Java a try and just use the Java classes in CF.