Has anyone done the work to enhance Darron Schall's ObjectTranslator
class to work recursively, as he describes in the source code?

In the absence of that, I was think of adding static factory methods
to my VO objects, as follows:

static public function newInstanceFromJSON(json : String) : StudentVO {
        var student:Object = JSON.decode( json );                       var
studentVO:StudentVO =
ObjectTranslator.objectToInstanc(student,StudentVO);

        for ( var i:int = 0; i < studentVO.books.length; i++ )
        {
                var bookVO:BookVO = ObjectTranslator.objectToInstance(
studentVO.books[i], BookVO ) as BookVO;
                // Use the converted class instance in place of the regular 
object
                studentVO.books[i] = bookVO;
        }
        return studentVO;                                               
}

Comments welcome.

Reply via email to