Muse Reader Howard Asks:
I'm trying to implement the Impel HTML5 ORM on the front-end of a CF powered app. The Impel docs have an example of a PHP JSON web service that is used to return some table version information. They say that the service should return an "array of objects, but I'm a bit stumped as to how their PHP snippet would translate to CF. Could this be a struct? Here's the snippet,
While I'm not certain I have enough information be sure I'm answering your question, I can tell you that implementing an array of objects is pretty easy if you are using ColdFusion 8. Check this out:
Howard, you sound like you already know a good bit of this, but for the rest of you out there I believe this is usually refered to as an "implicit" object constuctor - meaning the type of object created is assumed due to the way the values are arranged in the code. It is a common feature of most languages - including PHP. It is something of a late comer to ColdFusion, but better late than never. Rather than bore you with my own inimitable style I will refer you to the excellent writing and analysis of ColdFusion Guru and all around smarty pants Ben Nadel. See his post on Implicit Struct and Array Creation.