Here's something I wrote and submitted to the project, not too long
ago. I haven't noticed any describeType() lag, but then again I
haven't extensively profiled it. Hope this helps.

http://code.google.com/p/as3corelib/issues/detail?id=22

- Brent


--- In [email protected], "Richard Rodseth" <[EMAIL PROTECTED]> wrote:
>
> 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